The folks who join Starfleet are a bit insane anyway. In a population of trillions, it shouldn't be that hard to find a few million volunteers for unpaid work fraught with deadly dangers. Hey, they find suicide bombers in sufficient numbers in our reality, too!
I think insane is an exaggeration but people with dangerous occupations are certainly not necessarily rational (if the pay is high it might be rational) and definitely not hedonists. And yet there are been ample of people who wanna become soldiers or fly to the moon with tons of hydrogen burning under your feet without becoming rich in the process.