Yikes. Glad I didn't join the service.
In the real world, I don't know if too many amenities would be given to people who have issues with confined spaces... in fact, people with claustrophobia might be passed over for consideration in the service, or would be asked to seek help before applying - or they might be promised to be given professional assistance in this matter if they do apply.
A lot of what is done in military settings, or settings where there is a very strong hyerarchy (aka chain of command), there's also a lot of emphasis on 'toughening up' and not necessarily a lot of support for mental health (though if I'm not mistaken, it wasn't until last year that mental health toolkits were rolled out throughout the royal navy for example - but as we know, its one thing to have support for things on paper, and something else to see it working in practice (which often falls short of proper implementation - to say the least).
If we're talking about Trek, its possible people with claustrophobia would be assigned a bit more space if possible, or certain accommodations will be made to try and meet their needs... at least in Starfleet.
Barclay for example came into service with phobias, and its not so unusual to see people with claustrophobia in Starfleet.
My guess is that in Trek, people with certain 'problems' (or how they classify problems) are in fact allowed to join and every effort would be made to accommodate for their needs and minimize exposure to environments that might aggravate their conditions (if they have any).
After all, people can still be in different positions in SF, and have 'disabilities', and contribute massively on the whole in service to Starfleet.
Plus, I'd be surprised if SF didn't provide mental health services to people to help deal with any conditions they might have and minimize their impact on the person - and of course, there are treatment methods that work with curing claustrophobia.
Hoshi Sato was claustrophobic and she was on the NX-01 which arguably had less space allocated to a crew member than what is usually available on larger ships in the 23rd and 24th century.