A politician who resigned from his post in the Welsh government last week after allegations of misconduct has died.