A Labour MP has said he regrets making “badly misjudged” comments after Sir Keir Starmer sacked him as a minister.