Greece legalized gay marriage because the current conservative government(which opposed it in the past) decided that it was more useful to deny the "gay marriage" as a weapon for the opposition and made it legal.
Still, only half of their mp supported the bill and the bill passed because the opposition supported it.