> For example - in my country gay marriage was made explicitly illegal with a constitutional amendment in 2005.
Are you referring to the US?
Many US states passed state constitution amendments (some in 2005) to limit legal marriage and its rights/ privileges to heterosexual couples; it wasn't illegal as in a crime, nobody was getting arrested, but folks were being discriminated against by the government.
In 2010, then-President Obama repeated his opposition to same-sex marriage. It wasn't until 2012 and running for re-election that his position "evolved".
Same-sex marriage was not mainstream until very recently, even in supposedly liberal nations.