So many great answers. Wanted to throw in a few. Clearly, the out-of-world explanation helps explain the reality of the situation - big sets, easier to shoot (the TNG series was filmed on some fairly large studio equipment from the 1980s, cameras with wheels and tracks and such), and generally looks more glamorous, so it fits the theme of a Utopian-like future (for humanity, at least).
In-universe the long-duration missions are used to explain all "luxury-like" accommodations included (schools, arboretum, holodecks). It is established in "Lower Decks" that not everyone enjoys large quarters but our primary characters all have a good amount of space (similar to all the Trek series, excepting maybe Enterprise).
Technologically, it also makes more sense than it would on a modern day aircraft carrier. First, modern day aircraft carriers (from the US Fleet) have a personnel complement much higher. The recently deactivated USS Enterprise CVN65, for example, housed up to 4,600. TNG's Enterprise only houses ~1000 (including civilian families) with much larger emergency capacity.
Further, the Navy has to worry about gravity, whereas the Enterprise-D has to worry about structure. The larger those naval quarters, the more deck space, the more weight, the more furniture, etc. (just think how much space replicator functionality would save, food has to be stored somewhere). All of that mass adds up, so it's not so much that space is at a premium as it is mass. They could make bigger aircraft carriers but then they'd be even bulkier and more difficult to move, maintain and protect.
The Enterprise-D, with it's technology, just needs to form a stable warp-bubble and voila the "weight" of the thing is irrelevant. So you can afford spacious accommodations, large cargo decks, large shuttle bays (even the ones we see on camera were many times larger than the most efficient bay could imagine; ENT's shuttle bays for example) because your concern is the structural integrity of the vessel, not the weight.
The same could be said of modern spacecraft, things are tight because it's expensive to rocket all that mass into orbit. However, designs have been discussed like "inflatable spacecraft" that would allow relatively spacious accommodations. Just a matter of maintaining the integrity of the space vessel.
So, in-universe it makes sense that they'd have spacious quarters to match the rest of the spacious nature of the vessel. (Fun question)