The same thing that prevents them from just having glass down the entire length of the fuselage, rather than discrete windows: the ribs of the frame.
This picture from cpast's answer on UX.SE shows how the windows are placed relative to the frame:

On smaller aircraft, they probably could install small windows like the ones beside the passengers in the roof of the aisle, but it would add design complexity and also heat up the cabin (especially when sitting around on the ramp.) I'm assuming the cost/benefit ratio there was just deemed not worthwhile. Having them directly above the passengers wouldn't work because that's where the overhead storage bins are.
In the case of wide-body aircraft (like the one picture above,) note that the actual top of the fuselage is quite high. In addition to the overhead storage bins above the passengers, there is often other stuff between the ceiling of the passenger cabin and the actual top of the fuselage, such as crew rest quarters, pipes, cables, or, in the cases of the 747 and the A380, another entire passenger cabin.
An additional problem with this is that it would make it harder to control cabin lighting, unless the windows were electrically dimmable, like the new ones on the 787. Longer flights will usually want the passenger cabin to be dark-ish in order to accommodate the passengers who want to sleep. With the windows beside them, passengers can open or close their window depending on how much light they want. That wouldn't work for windows in the ceiling (since they would affect multiple rows of passengers.)
Further Reading
Window size limitations are also discussed in Why aren't airliner windows aligned with their seats? and the previously-linked question on UX.SE.
vertiginous gastronomical expulsions
- @CGCampbell, that is quality word smithing right there! $\endgroup$