Actual navy ships do have shipboard bars and lounges. Aircraft carriers even have movie theatres and bowling alleys. You seem to be falling into the trap of believing the military is a completely spartan and utilitarian environment, though the truth is modern militaries are anything but.
Despite TNG being the poster child for the "not a military" claim, there is absolutely nothing "non-military" about the Enterprise D aside from the fact its captain and crew deny being a military. As already noted, Star Trek takes a simplistic approach to showing the military as stiff, formal and bad tempered refusing basic luxuries while showing the fact that Starfleet is more relaxed, personable, reasonable and willing to do something other than combat as proof it's not a military. But really, if an actual military had access to technology and resources of the 24th century, they might very well make a ship very similar to the Enterprise D. The US military of today spend millions of dollars dedicated purely to the entertainment of its personnel. If they had access to holodecks, you'd damn well better believe bases and ships of today would have them, even if their primary use was to reenact Shakespeare or Sherlock Holmes or if it just became a virtual brothel. Likewise, the idea of bringing families along on ships that were supposed to be on long term assignments isn't so far fetched, there are already plenty of bases that house the families of its personnel.
And the truth is, I suspect even the writers of the modern shows realize all this. Ron Moore has admitted he views Starfleet as a military but adhered to the official party line that it wasn't because that's what he was told from above. The officially licensed novels get away with calling the main characters of the shows propagandists for claiming Starfleet isn't a military. And at the risk of paying a tithe to the coin jar, I find it very telling that there is a TV show on the air now with several writers who are former Trek writers featuring an organization similar to Starfleet in most respects with the only real difference being these characters admit to being a military.