It's the Empire that's playing into the Thalmor's hands, not Ulfric. When you choose siding with your enemy over your subjects, you've lost your kingdom, and that's what the Emperor has done with the WGC.
So how does helping the empire play into the Thalmor's hands? Its not like the Thalmor can attack Skyrim if the dragonborn is there. They last about two seconds against a storm call. And the rest of the empire, able to get troops from Skyrim, is all the stronger for it.