“Star Trek,” and some earlier pieces, are a sub-trend, as it were, in that way. (By always, I meant “throughout the existence of these genres,” not “every individual piece.”)
The fantasy of a world without religion, money, poverty, ignorance, and so on goes way back ... although it appears that more people believe such a scenario is both possible and desireable than used to.
No politics in Star Trek either. Just a benevolent UN writ large.