Get to O-6 and your probably in a command position. Those tend to come with on-base housing, regardless of marital status.
BOQ? No way an O-6 is going to live with a bunch of butter bars, 1st LTs, and the odd captain on TDY.
Some of it depends on where the BOQ is (not for "permanent" housing, but for TDY type stuff). While not in the mil, I stayed in BOQs here and there over my career. Some bases have really nice TDY housing, others, not so much. It also depends on rank.
As a civilian, when I stayed at a BOQ, they used the billet equivalency chart. So when I was a lowly GS-12 (O-4 equivalent) I had that shared bathroom apartment. When I stayed at that same base (Lemoore NAS) as a GS-14 (O-5 equivalent)* I had a nice unit in, I forget if it was a duplex or triplex, with a backyard, BBQ area and stuff, and my own dang head.
At Point Mugu NAS (part of NBVC), they even have beach bungalows. The Director of my office, an SESer, was out one time for some meetings we were having with the Navy, and they put him up in the beach bungalow (SES=one of the Admirals). We hung out one night having cigars and whiskey there - it was really nice.
I've never stayed at one, but have heard that the Army BOQs are the worst of the services. I've only stayed Navy and Air Force.
* That billet equivalency chart is a big ripoff. GS12=O-4, GS-13=O5, and GS14=O5. So getting the GS14 promotion got me nothing SWAG-wise compared to 13.