Ms. Reynolds, a Republican, had praised Mr. Foxhoven as a “compassionate, thoughtful leader” when she appointed him in June 2017. He had previously worked as a lawyer, professor and children’s rights advocate.

He said he had been brought in to “right the ship” and raise morale during a period of turmoil at the agency, including fallout from the deaths of two teenagers who had been adopted out of foster care and major problems with the Medicaid system.

“We made a lot of progress,” he said.

He added that many directors do not serve long terms, and that his two-year tenure meant that he had outlasted many of his predecessors.

Ms. Reynolds had served as lieutenant governor under Terry Branstad, who was nominated as ambassador to China in December 2016. She assumed the governor’s office in 2017 and won an election for the seat the next year. Mr. Foxhoven said he believed she was simply filling posts with “more political people.”

Her office did not return calls on Wednesday. Last month, she told reporters that “a lot of factors” had gone into the decision to remove Mr. Foxhoven, but would not say whether the move was tied to disciplinary action. Gerd W. Clabaugh, the director of the Department of Public Health, was appointed as interim director of human services.

Mr. Foxhoven said his quoting of Tupac and his holiday messages were meant to “add a little levity and humanness” to the office. He added that he had been a Tupac fan since the ’90s.

Image Tupac Shakur in 1996, the year he was killed. Credit... Frank Wiese/Associated Press

“I would say Tupac is by far my favorite, second would be Snoop Dogg,” he said, adding that he also likes jazz and rock.