User blog comment:KillRoy231/Mary and Lucifer to return/@comment-67.168.91.127-20170622060518/@comment-1975828-20170622072913

Look it up yourself (or are you just typically lazy?)

Sera Gamble didn't like Castiel. You could tell just by the way she wrote him. It was intentional that he played a bad guy and died because of it. However, Castiel returned mid-way through Season 7 because the show's ratings dropped.

He returned because he had to be brought back.

Also, this isn't the first time they've tried to kill off Castiel. Every other attempt gave poor results so he had to stay. There was no other choice.