The warning from Nationalist MSP John Mason comes as the Scottish Government this week prepares to formally introduce its Marriage and Civil Partnership Bill at Holyrood.
However, the SNP is facing opposition within its own ranks to the move, with some ministers refusing to publicly back the shake-up of the law on marriage.
Mr Mason claimed teachers who oppose gay marriage could end up being “persecuted” if they state their position on the issue at school.
He highlighted the case of the owners of a Berkshire guest house being forced to pay compensation to a gay couple after they refused to rent them a double room. He insisted legalising same-sex marriage would create similar conflicts, arguing teachers should be allowed to opt out of speaking about the issue in classrooms.
The Scottish Government has pledged that if the bill is passed, no church or religious celebrant will be compelled to conduct same-sex marriages.
Mr Mason has warned that critics of the legislation working in the public sector would be vulnerable to disciplinary action.
He said: “I want to know if there will be protection for employees, such as where a teacher says they disagree with same-sex marriage.
“I’d Iike a set guarantee, like with abortion, so that a teacher could opt out of this, but I’m not convinced we’re going to get that protection.
“I personally disagree with it [same-sex marriage], as it goes against Christian teaching, but in a live-and-let-live sense it’s not for me to tell people how to live their lives.
“My concern is that people could be persecuted for giving their views.”
The SNP leadership is allowing its MSPs a free vote on the bill, although First Minister Alex Salmond and his deputy Nicola Sturgeon have strongly backed the reform that will begin its journey through parliament either tomorrow or Thursday.
Scotland’s learning minister, Dr Alasdair Allan, said he would not be voting for the bill because of opposition to gay marriage within his Western Isles constituency. He said: “I have to respect the views of people in the Western Isles and I’m not likely to vote for the bill.”
SNP MSP Dave Thompson, who opposes the bill, said same-sex marriage could lead to the “erosion of free speech”, with preachers prevented from publicly criticising gay weddings.
However, equality campaigners dismissed suggestions that teachers opposed to gay marriage would face discrimination.
Tim Hopkins, of the Equality Network, said: “Schools will deal with same-sex marriage in the same way they deal with divorce, which some teachers also personally disapprove of.
“Teachers would need to confirm the facts of the law, and must be supportive and fair to all pupils regardless of their family background, but no teacher will be required to say that they personally approve of divorce or same-sex marriage.”
Scottish Green co-leader Patrick Harvie said opponents of gay marriage should not “use their position to promote homophobia”.
Scottish Secondary Teachers’ Association acting general secretary Alan McKenzie said the union would “encourage our members to watch what they say at work”. He said: “If somebody made racist comments they’d be in danger of disciplinary action and it’s no different from that.”