What do you call someone who substitutes one inappropriate word for a similar word?
Solution 1:
You might be looking for "malapropist" as a personal form of "malapropism".
Malapropist: a person who regularly makes malapropisms - Collins Dictionary
Malapropism: the use of an incorrect word in place of a word with a similar sound - Wikipedia
Solution 2:
If the substitution is an accidental, and erroneous, substitution of a similar sounding word, such as "pineapple of perfection" instead of "pinnacle of perfection" the error is a "Malapropism", after Mrs. Malaprop, a character in Sheridan's The Rivals. The person who does it would be a "Malapropist".
If the substitution is a transposition of sounds, such as "queer old dean" for "dear old Queen", the error is a "Spoonerism", after Rev. William Spooner, famed for making such errors. The person who does it would be a "Spoonerist", I suppose.
If the substitution is a deliberate substitution of a harmless word in place of an offensive one, such as "expecting" for "pregnant" -- standards for "offensive" used to be very different -- or the omission of the offensive word altogether, the change is a "Bowdlerism", after Thomas Bowdler, a publisher notorious for making such changes. The person who does it would be a "Bowdlerizer".
If the substitution is a deliberate substitution of a similar sounding nonsense word in place of an offensive exclamation, such as "Zounds!" for "God's wounds!", the replacement is a "minced oath". The person who does it might be a "mincer".
Solution 3:
If it's a transposition of letters leading to a spoonerism (which are funnier the more inappropriate the result) the speaker spoonerized