Cynical assumptions about human morality aside, the culture of Earth in Star Trek is such that most will, and those who do not are fringe elements that can be counted on a few fingers.
While the show does focus on Starfleet, we have seen examples of people who live in Humanity's civilian society.
I can immediately remember only one adult man who spoke of being unemployed and Picard responded to this information with a small degree of shock and disapproval. We see civilians with jobs of one sort or another, spouses and children might not work, but
if the subject is addressed in the dialog, there is a employed "bread winner."
A portion of the "optimistic future" could include a society of near universal employment. This would account for a lack of homelessness and poverty. It's a society where people have the ability to take care of themselves and therefor don't require the guy in the mansion (or the government) to do it for them.
What episode is the unemployed guy in? Not recalling it.
A world in which in which everyone has the resources to survive and works because they want to contribute to society and a world in which everyone works at a sustainable wage are very similar, but the second one says you're only working to avoid the spectre of starvation and homelessness and if you become ill, injured, or aged that you're left to die. I think a world where people contribute to society because they believe it's worth doing (because it is) and it's rewarding (because it is) is more positive and more in keeping with Star Trek.
Functionally, the worlds are very, very similar.
The mansion is just a metaphor: Our culture asks, "if you have physical wealth, why would you give it away?" Star Trek's Earth asks, "if you have physical wealth and others need it, why would you keep it?"
There's no reason for someone to sit cloistered in a mansion on a hill while others go homeless.
Why a "mansion on a hill" as opposed to a humble apartment in the valley, wouldn't the principals be the same? If you were somehow directly responsible for a individual being homeless that might confer upon you a personal obligation for their shelter, but not generally for everyone.
When this subject has come up in the past on the board, I've suggested that a future Earth society could have community shelters as part of a social safety net. But that would not translate to a homeless person being able to walk into any private home of their choosing and taking up residence.
Where was the "homeless dude" who lived in Robert Picard's rather large country manor?
Again, you're looking at things in terms of someone
taking. You're thinking in terms of "someone else" or government taking care of the homeless. In Star Trek, you don't have to be responsible for someone being homeless to help them out. That another person is homeless and you have the resources to share is enough reason to help. "Let me help," those three important words where the people of the future
insist on giving from themselves to help others.
The future of Star Trek isn't a better world than our own because idle homeless people fill every spare bedroom; it's a paradise because folks aren't declared useless by society because a spreadsheet said the ROI for a science school for teens wasn't right or because federal funding for space shuttle research got diverted to pork barrel projects or because someone wanted to improve their profits %3 by slashing their workforce for Q3.
Most people will contribute to society if they can and
most people will help others if they aren't afraid of losing what little they have. The removal of artificially-competitive, artificially-meager economic systems designed around the pursuit of material wealth is what enables the future to be better.
It's literally Madison's government by men who are angels; that's Star Trek.
But they do have government, so by extension the "men" in the Star Trek universe are in fact not angels.
James Madison: " ... if men were angels, no government would be necessary."
I don't--yes, that's the quote I was referencing. If you believe popular management is a sign of evil, man, I can't even begin to argue. Obviously, Star Trek canon is laden with corrupt/stupid admirals and questionable actions by Starfleet and The Federation Council (
Insurrection wasn't just a fevered dream, right?)
The reference is another example of an idea. It's not a literal thing. If people are good they don't need to be forced to be good people. A culture which fosters empathy, shuns greed, and praises folks contributing to the common good solves more problems with pats on the back than government can with guns.
If you need to threaten people with starvation or guns for your utopia to work, then I would seriously call into question its status as a utopia.