The Church justifies such membership as it has always justified its entanglement with worldly power: it is more important that it be able to somewhat influence the State than that it remain unsullied from everything the State does. It can’t really be sullied, of course, but it can appear to be (causing scandal), but such scandal is not as bad as the State would be without the Church.
There are three alternatives to this: Hermitage, Ultramontanism, and Caesaropapism.
Hermitage means the Church leaves the world to its own devices, which is not an option since not everyone is a monk.
Ultramontanism is vesting supreme secular power in the Church herself, making the Pope also the Emperor. This is bad because worldly leaders have, among other things, to use force (which is inappropriate for a priest). The Papal States had this condition for a while, and it didn’t work out well at all.
Caesaropapism is giving the state control over the Church. This is even worse than Ultramontanism–think the Avignon Papacy rubber-stamping the purge of the Templars. This has often been a problem in the Orthodox Churches, especially in the days of Byzantium, and again under the Tsar.
The Church has chosen the (perhaps less-than-ideal) option it had during the Middle Ages, the Enlightenment, and modern history: it has ties to power, so that it can manipulate power to serve Christ.