Canon Jeremy Pemberton was refused a licence to work as a hospital chaplain by the then acting bishop of Southwell and Nottingham.
Mr Pemberton brought a discrimination case which started in June.
The Nottingham Employment Tribunal heard final submissions from both parties earlier on Tuesday.
Although Mr Pemberton was employed by the NHS, a required licence from the diocese to work at King's Mill Hospital in Mansfield was refused by the Rt Revd Richard Inwood.
He argued that the marriage was against the Church of England's teachings.
Thomas Linden QC, representing the church, said: "The state should not be saying to a religious organisation you can or can't choose this person as your priest.
"The tribunal should say it's clear on the evidence what the church thinks of same sex marriage."
He argued Mr Pemberton went against the doctrine of the church when he entered his same-sex marriage in "a blaze of publicity".
Sean Jones, representing Mr Pemberton, suggested the church would not have had an issue with Mr Pemberton if he was in a civil partnership, even though he claimed they were nearly the same.
He added that nothing stopped clergy from entering into civil partnerships and questioned why it should be different now another type of "civil union which the state calls marriage" has been introduced.
A final conclusion is not expected until next year.

The Resolution Foundation analysis shows the impact of the national living wage will vary considerably across Scotland.
A national living wage of £7.20 an hour for workers aged 25 and over will be introduced in April.
The UK government said millions of people will enjoy a pay rise.
The study said 500,000 employees in Scotland will be affected overall.
While one-third of employees in Clackmannanshire and Dumfries and Galloway will be affected, just 16% of employees working in Aberdeen are set to benefit.
Edinburgh (17%), Dundee (18%) and Glasgow (19%) are also significantly lower.
While strongly welcoming the new wage floor, the Foundation notes that implementing it will prove a greater challenge in lower-paying areas.
It calls on the Scottish government, the Fair Work Convention, local leaders and businesses across the country to work together to minimise any job losses and ensure large groups of workers do not get stuck earning only the legal minimum.
The Foundation also calls on employers to focus on boosting productivity in retail, hospitality, cleaning and care to ensure the national living wage is affordable for them.
The group states the UK government's new pay structure is not actually a "living wage", and calls for an expansion to the voluntary living wage of £8.25 across the country.
Conor D'Arcy, policy analyst at the Resolution Foundation, said: "The welcome new national living wage will have a huge impact on low pay, particularly towards 2020 as it approaches £9 an hour.
"While our analysis suggests the pay rise should be affordable for most firms, implementing the new wage floor will be challenging for some employers. That's particularly true in areas where wages tend to be lower.
"Politicians must work closely with employers to ensure that the national living wage is a success, particularly in low-paying sectors."
A UK government spokesperson said: "The government is making sure Britain gets a pay rise and that businesses have the skills they need to succeed. We are already seeing record employment rates and real wages growing to levels not seen since the recession.
"As the report itself highlights, workers in some cities will see even bigger benefits, reinforcing our drive to rebalance the economy through the northern powerhouse and the devolution of powers to local government and cities."
A clergyman may have to wait until next year to find out whether a decision to remove his right to officiate after he married another man was discriminatory.
[NEXT_CONCEPT]
About one-third of workers in Clackmannanshire and Dumfries and Galloway will benefit from the national living wage, according to research.