It seems like a spoonerism is unintentional. I feel like a pun for most people means word play.
Spoonerism. a verbal error in which a speaker accidentally transposes the initial sounds or letters of two or more words, often to humorous effect, as in the sentence you have hissed the mystery lectures, accidentally spoken instead of the intended sentence you have missed the history lectures.