Simple. Several options are available to you:
The I'll get there but die after stuff
You have a situation where the surface is so full of radioactive materials (possibly a byproduct of nuclear war?) that everyone had to migrate downwards in order to avoid radiation. If anyone goes up, they die of radiation poisoning.
You have a "surface" that's always stormy, with ludicrously high winds and flying debris all the damn time. Walking outside? Not a chance, you'd get blown away and ripped apart between storms.
More insane? What about if your planet was in a system where there your planet was prone to being hit by asteroids? Being on the surface means you'd get hit by one or two falling rocks at least several times a day - good luck surviving that.
How about considering an atmosphere-less planet? Your people have terraformed the inside of a big rock to live there, but because the rock wasn't big enough to sustain an external atmosphere, you've elected to seal an internal atmosphere inside your cave system. Anyone breaching the surface will kill everyone in the rock unless the hole is sealed, and if you walk outside the air in your lungs will kill you.
Consider the opposite of the above. What about an atmosphere that doesn't have oxygen in it? Perhaps it's a CO2 atmosphere. Walking outside = suffocation.
Those are some of the environmental possibilities, but what if the surface of your planet was uninhabitable because of predators? Perhaps you've got a human hunting race that lives on the surface, and going outside = being hunted.
Of course, if you prefer the "literally can't reach the surface" stuff
From a more generic perspective: your world contains an element that is so hard that you can't break it. Cover the surface with it.
Lets step into Crazyland for a second. Let's say for a second that the planet was encompassed by something "alive" - perhaps a really really fast growing plant. The ceiling you think is stone/rock/dirt/whatever is really actually that plant, which happens to (for whatever reason) grow in the shape of a hollow sphere. Trying to dig through this plant would result in instant regrowth, and you'd probably lose your tools trying to do it. Enough of Crazyland, lets get out.
Alternatively, have creatures that live near the surface but still underground, but not deep enough to harass your citizens (Giant man eating worms that don't like warmth, perhaps). They're advanced creatures, and can detect vibrations in the earth. Once a digger gets above a certain depth, they go straight for his sorry arse and he makes a nice meal for said creature.