Rt Revd Richard Inwood was questioned at the employment tribunal of Canon Jeremy Pemberton.
Revd Pemberton is angry that he was stopped from working as a hospital chaplain by Bishop Richard because he was in a gay marriage.
The priest is claiming the bishop's decision to refuse the licence was a breach of equality laws.
Bishop Richard told the tribunal at Nottingham Justice Centre it was not about whether Revd Pemberton would have been good at the job but rather what was right for the Church.
He said: "It is not a matter of danger but by my own oath of honour and obedience, under authority, to maintain the doctrine of the church.
"It's my own personal decision."
Sean Jones QC, representing Revd Pemberton, asked the bishop if he feared any harm by letting the clergyman take the job.
The bishop replied: "Certainly no harm to the trust or the church,"
His answer prompted the tribunal judge, Peter Britton, to intervene.
The judge said it would have left the bishop with a "conundrum", stating: "If it was so fundamental to the doctrine, thus the breach would cause harm.
"But if you think it is of no harm to the church surely that means the reliance on this being fundamentally doctrinal as to otherwise bring down harm on the church is a busted flush isn't it?
Bishop Richard replied: "If you put it like that, I have to agree with you, sir."
But the senior Anglican figure later added that granting a license to a priest in a gay marriage would have been "incompatible" with Church of England guidance.
The bishop added that since making the decision to refuse the license he had been the victim of hate mail which he described as "bonkers".
"Some were well-argued, some insulting, and some cast aspersions on my own marriage," he said.
Bishop Richard said the letters were "very difficult" to handle but that he was "thick-skinned".
The tribunal continues.