Though Father Conroy said he did not know whether politics were behind his departure, he pointed to a prayer he had given on the House floor in November, when Congress was debating tax overhaul legislation.

“May all members be mindful that the institutions and structures of our great nation guarantee the opportunities that have allowed some to achieve great success, while others continue to struggle,” he prayed. “May their efforts these days guarantee that there are not winners and losers under new tax laws, but benefits balanced and shared by all Americans.”

About a week later, Father Conroy said, he heard from the speaker’s office. “A staffer came down and said, We are upset with this prayer; you are getting too political,” he said. “It suggests to me that there are members who have talked to him about being upset with that prayer.”

Shortly after, when he saw Mr. Ryan himself, Father Conroy said that the speaker told him, “Padre, you just got to stay out of politics.”

“That is what I have tried to do for seven years,” Father Conroy said. “It doesn’t sound political to me.”

“If you are hospital chaplain, you are going to pray about health,” he added. “If you are a chaplain of Congress, you are going to pray about what Congress is doing.”

Father Conroy said that was the only time anyone from the speaker’s office had ever chastised him for veering into the political realm. “I’ve never been talked to about being too political in seven years,” he said.