

Before the Markarth incident, the Empire didn't openly persecute Talos woshipers. They likely made a deal with Ulfric promising to support him if he gave them that excuse. The Thalmor wanted an excuse to operate openly in Skyrim.

The reason he retook Markarth isn't just because he's a racist who hates anyone who isn't Nord, though that's definately true, but because the Thalmor wanted him to.

He wants to rule all of Skyrim, and he doesn't care how he has to get it. The reason Ulftic worked with the Thalmor is the same reason he killed the High King, because he wants power.
