The ordinary arrangement in a South Indian Shaiva temple is that Shiva holds the principal shrine and the goddess a subsidiary one. At Madurai it is the other way round, and the reversal runs through everything.
The order of precedence
Meenakshi, the fish-eyed one, holds the principal shrine. Sundareswarar, a form of Shiva, holds the secondary one. Pilgrims visit her first. Her shrine is the one with the gilded tower over it.
Properly speaking this is a Shakta temple with a Shaiva shrine attached rather than a Shaiva temple with a goddess in it, and describing it as simply a Shiva temple gets the theology backwards.
The story that supports it
Meenakshi is born to the Pandya king as a daughter with three breasts, and an oracle says the third will vanish when she meets the man she is to marry. She grows up as a warrior and conquers in every direction, reaching Kailasa, where she meets Shiva, and it does.
The reading offered within the tradition is not that she is domesticated by the marriage. It is that Madurai's sovereign is the goddess, and Shiva marries into the city.
Vishnu gives her away
Vishnu appears as Meenakshi's brother and performs the giving-away at the wedding. A Vaishnava deity therefore has a necessary role in the central rite of a Shakta-Shaiva temple.
This is the useful thing about Madurai: the sectarian divisions that look rigid in doctrinal literature are, in the actual practice of a major temple, arranged into a family.
The marriage as the city's festival
The Chithirai festival re-enacts the wedding over about fifteen days and is the largest event in the region, drawing very large crowds. The deities are processed, the marriage performed, and Vishnu's arrival from Alagar Koyil is a set piece in its own right, he arrives late, which is part of the story.
The building
The oldest surviving masonry belongs to the reign of Sadayavarman Kulasekaran in the late twelfth or early thirteenth century. Malik Kafur's raid of 1311 destroyed and looted the temple, and rebuilding followed Vijayanagara's capture of Madurai in 1378.
Almost everything a visitor sees is Nayak work of the sixteenth and seventeenth centuries, the great halls, the gopurams with their thousands of painted figures, and the gilding over the goddess's shrine, raised under Vishwanatha Nayak and his minister Ariyanatha Mudaliar.