The finance secretary, who was first elected to Holyrood in 2016 and has been on maternity leave, said she would have voted against gay marriage in Scotland when it was made legal in 2014 because it clashed with her views as a member of the Free Church of Scotland that marriage should be between a man and a woman.