The Church does not talk politics, but it does talk morality. And if the politics of the situation strays into moral questions, the Church ends up talking politics by extension.
Abortion is a good example. The Church considers the unborn to be people, equally worthy of protection of the State as all citizens. If the State legislates to legalize abortion, it is abrogating its temporal responsibility to protect its citizens. The Church is duty-bound to speak out. A politician who is Catholic but supports abortion is not only failing in his moral duties as a Catholic, but also in his duties as a politician, at least as far as the Church is concerned. The politician cannot use the excuse "I have a duty as a lawmaker" because, in the eyes of the Church, both his duties as a Catholic and as a politician must lead to the same conclusion. Since abortion is morally evil, this double failure demands that the Church apply what disciplinary and corrective measures it has available to it.
Now compare that with the issue of war. The Church has always recognized that war as a matter of statecraft is the perogative of government. To aid Catholics, there are the Doctrines of a Just War. What the Doctrines provide is a set of principles to use to evaluate the justification of a specific war. But no one has perfect information, and everyone weighs different factors differently based on personal bias. As a result, two Catholics of good conscience can apply the Doctrine and come up with different answers. That includes the Pope. So if a Catholic politician can justify support for a war in an intellectually reasonable way, he won't be subject to discipline over the matter.
Same-sex marriage is another case. The definition of marriage is not redefined for each individual marriage, in the way the justification of a war is done for each individual war. The Church maintains a single universal immutable moral definition of marriage. By redefining marriage, the State has made its definition of marriage incompatible from that of the Church. It is therefore an immoral form. Based on past experience, the Church has a basis to believe that the protections in the bill for the relgious autonomy are going to be ineffective. Moreover, the Church makes the argument that the redefinition of marriage will have profoundly negative moral effects on society. For a Catholic politician, to oppose Bill C-38 is to defend both the Church and the State from an immoral law. To support the bill is to fail in both tasks, and represents a failure in being a Catholic and a politician. Such a person is a poor example of a Catholic, and is letting his constituents down. Until the person recognizes his twin moral failures and takes steps to address them, he is clearly and publicly in a state of sin, and the Church is justified in apply corrective pressures.