the speculative imaginings in other sci-fi works generally focus exclusively on future technological advancements while the world's sociopolitical climate remains relatively unchanged
I suggest you improve your sci-fi diet. There are literally thousands of far better fleshed out, better thought out and more interesting and realistic portrayals of the ramifications of potential technological, social and political changes in the future, they're just mostly in the form of books, not crappy TV shows or movies, which are developed using a process that seems designed to filter out most of what's actually good about science fiction.
i mean, the Federation is basically a pan-galactic egalitarian communist utopia. but this isn't just a random utopian fantasy; everything is thoughtfully reasoned and explained in a way that actually makes sense
Not particularly; the technology doesn't make sense, the portrayed capabilities aren't taken anywhere near their logical conclusions, and frankly most of the universe is left completely untouched; let's face it, most of Star Trek takes place on at least semi-military spaceships, of course it looks like a communist utopia; they're mostly crew. The day to day lives of ordinary citizens is handwaved away with a few soundbites like:
once replicator technology is invented, a capitalistic economy and consumer culture no longer make any sense, and want & poverty are also eradicated
But that's bollocks; it simply shifts your economy from being driven by materials to being driven by (utterly humungous amounts of) energy and knowledge. You want the latest and greatest hovercar? Well, those engines didn't develop themselves, the 50 petawatt hours of energy for a small 2 tonne vehicle didn't magic itself into existance, and the replicators sure don't maintain themselves, the software to run them doesn't write itself, even the sleek fashionable bodywork doesn't spring into existance out of thin air. Replicators can't even make everything, so chances are you'll need to pay for some good old fashioned non-magic manufacturing to go with it; if nothing else, some assembly might be required, since replicators seem to have some upper limit on practical size.
But no, Star Trek goes with "replicators solve everything and everyone lives happily ever after, so let's go and do another stupid holodeck episode because the reality we made was too boring to make another show about".
and with nation-states similarly abolished (and without people fighting for resources), a military serves no purpose
Right, making a cup of tea involves generating and moving around the energy of 475 Fat Man nuclear bombs (assuming 100% effeciency at all points) and there's no longer any problem of resources. That sure does make for interesting social commentary. Also, people no longer have any real ideologies, and certainly don't disagree with anyone over them; there's no terrorism or politics, except out in space, where the implications of these sort of energies being thrown about are never really considered, even at times of war.
likewise, religion would be a cultural anachronism in an advanced spacefaring civilization with extensive scientific knowledge
Again, unlikely oversimplification. We have pretty extensive scientific knowledge *now* and still 90% of the planet is still rather religious, and much of the rest have some pretty strange ideas. Commenting on social and cultural progress should typically involve a little more than some just-so stories which completely ignore most of the issues involved.