Sometimes, but not this one. The Federation is an impossible society, and it can teach us nothing about the real world.
It wasn't intended to either. The writers realized early on that Roddenberry's ideas were deluded and so they carefully avoided any plot that might get too close to exploring Federation society. There are a few quotes where they discuss their frustrations with Roddenberry's ideas. ST:TNG spends much more time on alien non-Federation races than the Federation itself.
Eventually the writers and especially DS9 manages to smoothly steer Roddenberry's universe back to something approximating human reality and exploring Federation life becomes possible. But the early years of TNG are largely a writeoff from a social commentary perspective.
I agree. Roddenberry was a genius at inspiring enthusiasm for a vision of the future that is delusional in the Maoist way and in other fundamental ways.
Our critics (e.g. thoughtful sci-fi authors like David Brin) should have criticized Roddenberry much more strenuously than they actually did.
I believe you somehow managed to miss the basic idea and storytelling approach of Science Fiction as a genre.