They think it makes them look macho and that voters will swoon. Bad news, boys and girls...it just makes you look immature and not fit to govern.
Swearing certainly has been a feature of (private) political life since forever, but normally for a reason and then only to your aides, never in public and certainly never as a vote-getting strategy.
People that cant communicate without swearing have a poor command of the English language.