David Nisbet, 28, from Edinburgh, pleaded guilty at the city's sheriff court to committing a breach of the peace and was fined Â£600.
Fiscal Depute Bruce Macrosson said police received calls about a man on the United Free Church of Scotland roof in Bangor Road at about 22:30.
It took firefighters 30 minutes to get him down.
Despite repeated requests to him to come down, the fire service and police were called in. "It took the fire service half an hour to get him down" said Mr Macrosson: "and he was arrested."
Defence solicitor Chris Fehilly told Sheriff Derrick McIntyre that Nisbet had been in court on a domestic matter that day.
"Why was he on the roof?" the sheriff asked.
Mr Fehilly said: "There is no reason. He was very, very drunk. It was a hot day and there is simply no reason why he was up there". Mr Fehilly said his client had apologised for his "stupid, idiotic act".
He added: "He was lucky to enough to get himself up there and get himself down".
Sheriff McIntyre told Nisbet: "This is going to cost you a lot of money", before fining him.
A man who had spent Friday drinking had to be rescued from a church roof by the fire service.