The Enterprise-D was a symbol of life in the Federation of that era. They enjoyed decades of prosperity and relative peace, and the design philosophy of the Galaxy class reflected that.
The Enterprise was built for deep space exploration and was (in theory) supposed to be deployed for years at a time without returning to Earth. The designers wanted it to be comfortable, and Starfleet personnel wanted their families to be with them on those long haul missions.
Being a major power in their part of their galaxy that was technologically advanced and at relative peace with other major powers, they were a little full of themselves.
Not long after its mission started Starfleet began encountering forces like the Borg and the Dominion, and they realized they weren't quite as untouchable as they thought. This became a major theme both in-universe and in the real world.