So that’s why.

Kevin James said his sitcom “Kevin Can Wait” killed off his on-screen wife after last season because “we were literally just running out of ideas.”

In an interview with the New York Daily News published over the weekend, James offered insight into the decision to fire actress Erinn Hayes, who played his better half, and give a full-time role to Leah Remini, who played his spouse in the long-running sitcom “The King Of Queens.”

“I get that people are like ‘Whoa, why would you do this?’ But it really felt like a thing like this was needed for this show to drive forward,” James said.

CBS Photo Archive via Getty Images James and Remini's characters are former cop partners in "Kevin Can Wait."

CBS previously announced that it would use the death of Hayes’ character Donna to advance the plot. James’ brief reference to her demise in a joke in the Season 2 premiere rankled some viewers.

But James insisted the change was needed to open up story lines for the family in a “different, weightier” way.

“The plot of the show didn’t have enough drive,” he told the Daily News. “If we got through a second season, I wouldn’t see us getting through a third one. We were literally just running out of ideas.”

CBS Photo Archive via Getty Images James and his now-"deceased" wife Donna (Erinn Hayes) in an episode from the first season.

The former cop partners played by Remini and James have a friendship and budding business relationship in a private security company.

Find out what happens next on Monday at 9 p.m. on CBS.