Father Matthew Despard refused to leave his home at St John Ogilvie in High Blantyre, South Lanarkshire, despite being ordered out by the Bishop of Motherwell, Joseph Toal.
He had been suspended by senior church figures after writing a controversial book alleging a gay mafia was operating in the Catholic clergy.
Bishop Toal ordered Fr Despard to leave the house in November 2013 after disciplinary measures were taken against him, but the priest refused to comply.
The Church took legal action against him and yesterday a civil hearing at Hamilton Sheriff Court heard Bishop Toal allege a hidden device that let out liquid had been placed near a door in the property.
Father William Nolan was appointed to replace Fr Despard at the parish, and it was claimed he discovered the device in January this year.
Bishop Toal said: "My memory is that there was some door that once you got it open, some sort of liquid or powder would come down on the person who opened it.
"I wrote to Father Despard at that time. I thought that he would have been involved. I was quite upset by it. There was an indication there might be some danger for Father Nolan being in the house. Other priests had said to me that they were concerned about Father Nolan's safety and this seemed to bring that out. I was also thinking about supply priests coming and whether it would be safe for them to come there."
The packed court, which has been attended by more than 40 supporters of Fr Despard, heard Bishop Toal claim the priest had photographed Fr Nolan while he ate his breakfast. It was also alleged Fr Despard removed the belongings of a visiting African priest from a room at the house.
Bishop Toal said: "He is continuing to live there in disobedience of what I asked him. There is a duty of obedience from a priest to his bishop and I think that is the kernel of this dispute.
"I decided to take civil action because of the difficulties that had arisen in terms of Father Nolan gaining access to the house.
"On the occasions he did gain access to the house the atmosphere was strained. Father Nolan told me Father Despard was photographing him in the morning at breakfast. There was a priest from Africa visiting and it was planned for him to stay at the parish house. He left his cases in a room there and the cases were put out of his room, I understand by Father Despard. There was an indication that he was not welcome, and he had to stay at a neighbouring parish house as a result of this."
Bishop Toal said he had repeatedly asked Fr Despard to meet with him and offered him alternative accommodation in a bid to resolve the row.
He said he had never evicted a priest from a church property at any time before.
He added: "It is very unusual, it was not something I had done before. I have said I would like to help Father Despard as much as possible, and that remains the position."
Fr Despard, 48, was suspended after he published a book claiming the Catholic Church in Scotland was dominated by a powerful gay mafia. It was withdrawn after threats of legal action were made.
Fr Nolan, 60, told the court that curry powder had been discovered in a jar above a door in the property. He said he and two joiners had forced entry to the house after Fr Despard changed the locks.
"It was a bit of a shock to discover these measures had been taken, particularly the barricading and booby-trapping. It was quite frightening really, and very embarrassing." He added: "I wonder of the mentality of the person who did that."
The hearing before Sheriff Joyce Powrie continues.