If the Moonbeam spell required the actual moon to be shining down, and somehow focused its light (or similar), you would assume that its text would reflect that. No mention is made of this, nor of the restrictions that it would naturally apply to use of the spell.
This wouldn't just be a problem indoors - consider phases of the moon, daytime, cloudy nights, or even eclipses. In fact, it would be an extremely limited usage spell.
Contrast the Call Lightning spell (Thanks Tashio for providing the text):
PHB Pg.220 Call Lightning
A storm cloud appears in the shape of a cylinder that is 10 feet tall with a 60-foot radius, centered on a point you can see 100 feet directly above you. The spell fails if you can't see a point in the air where the storm cloud could appear (for example, if you are in a room that can't accommodate the cloud).
If you are outdoors in stormy condition when you cast this spell, the spell gives you control over the existing storm instead of creating a new one.
This specifically says that it creates a cloud, includes limitations requiring you to be outdoors or have an incredibly high ceiling, and includes an additional effect if there is a pre-existing storm. Based on this, it seems clear that Moonbeam has no particular source or restriction whatsoever.
Obviously, you are the DM, and you are free to add fluff or requirements as you choose. But I would urge you to consider how limited this spell would become before you do.
I would allow players to make the spell cover any shape they wanted, provided that shape is simply defined, contiguous, has no "islands" or "doughnut holes", and no part of it is further than 60ft from the point they touch while casting the spell. By "simply defined", I mean simple shapes (cube, sphere, etc), or anything that can be expressed simply and obviously, like "inside the house" or "the area under the bridge".
I came to this ruling because it leaves maximum scope for the players to do what they want, while minimising the number of ways that it can become complicated, boring or overpowered.
Analysing the rules
Generally, where things are vague in 5e, the best way to approach it is thus:
- Do other rules have anything related to say?
- How would players generally be expected to use it?
- Which interpretation causes fewer complications?
- Which interpretation protects against abuses or ways to bypass balancing mechanisms (action economy, spell slots, etc)?
Related rules
The section on spellcasting doesn't mention how to handle spells that don't use one of the listed shapes. However, the alarm spell can be cast to cover "an area within range that is no larger than a 20-foot cube", which means there is precedent for choosing your own shape of area, within certain size constraints.
Expected use
I'd expect players to use hallow to protect areas like the inside of a place they're staying in - a house, a castle, a cave, whatever. This could be any shape, really, and as a DM there's no reason to want to spoil that for them.
Complications
Circles don't tessellate, and the players may wish to cover larger areas. Handling the bits of a circle that protrude out through the walls of a square house may be tricky (if you rule that this happens).
Balancing
The 24-hour casting time and 1000GP cost protect against serious abuses, and with those in place, I can't see a particular way that one shape is "overpowered" compared to another.
Ruling
Given these observations, I see no problem in letting players choose any shape they like. Of course, the spell says "you touch a point, and infuse an area around it", so no part of that shape can be more than 60ft from the point they're touching. This means that to cover a corridor that's 120ft long, you'd have to cast the spell from the middle. For the sake of keeping things simple, I'd probably also say that the area can't have "islands" in it - for example, you couldn't hallow a doughnut shape; you'd have to cover the bit in the middle. (This also prevents you from using hallow to trap things in the middle, which is the only thing I can see that might be open to abuse.) Likewise, you can't use one casting of hallow to cover two separate but unconnected areas, even if both of them fall within the spell's range. The hallowed area must be contiguous.
Reasoning
Letting the player pick the shape covers their intended uses, while also preventing situations that are either fiddly to manage or detrimental to the game's balance. In other words, it streamlines the playing of the game without blocking anything that's fun or adding anything that makes it less fun - which is the mark of a good rule.
For some examples, consider the following scenarios:
- The players want to hallow the inside of a small house, without having gaps at the corners or weird curved segments of hallowed ground outside it. Letting them choose the shape lets you divide it simply into "inside = hallowed" and "outside = not hallowed".
- The players want to hallow a larger area. Letting them pick the shape lets them choose a shape that tessellates. If you're playing on a square grid, they can hallow cubes; if you play on a hexagonal grid, they can hallow hexes. If they want, they can pick other shapes that fit the terrain, like "up to the edge of the cliff" or "120ft of road".
- The players want to hallow a small building, but the building is shaped such that they can't see all of it at once (perhaps three sides of a square). Letting them pick the shape lets them hallow it all in one casting provided that it's small enough. Given two buildings of equal floor area where one can be hallowed in one casting but the other takes several because of its shape is needlessly complicated for little gain in entertainment value.
Best Answer
The answer is implicit in the Player's Handbook, Chapter 10:
Obstructions that provide total cover, such as dungeon walls or floors, therefore limit the area of effect. This would mean that in your example, the cylinder goes from floor to ceiling, but not above, as the ceiling provides total cover to anything above it excluding the presence of holes.
As Anaximander puts it, you can think of the Area of Effect as light originating from the point of origin. If a target inside the Area is fully shadowed, it has total cover and is not affected, unless the effect is stated to spread across corners.