Why do whales have barnacles but dolphins, porpoises, and orcas do not?
-- Barnacle Bill the Sailor
Whale of a generalization, Bill, but sorta true. Barnacles are common on humpbacks and gray whales, but you'll sometimes find a few on a random porpoise or manatee or other marine mammal. Barnacles might spend their lives stuck to rocks and piers and whales, but they start out as free-swimming larvae. If they are lucky, they bump into something friendly at this stage, hang on, and set up housekeeping. So part of your answer is that whales swim much more slowly than other animals and are easier to latch on to and actually stick. And once they've stuck and matured, they can grow a whole colony of baby barnacles, like crabgrass spreading through a lawn.
Barnacles aren't parasites. While they might irritate a whale's skin, they don't feed on its body or otherwise do great harm. One species of barnacle is host-specific to gray whales. They've developed a nifty system of timing their reproduction to the whales' mating and birthing schedule at the Mexican lagoons, so a baby gray whale likely leaves for northern waters already infested with barnacle larvae. Individual whales can be identified by scientists according to the barnacle patterns they develop; the size of the patches also helps determine the age of a young whale.
Another advantage of whales over other sea mammals is that they spend all their time in salt water, the barnacles' favored environment. A manatee, for instance, has to travel into fresh water occasionally.
So what's in this deal for the whales? Nuthin'. What's in it for the barnacles? Plenty. When the little crustaceans are stuck to a rock, they have to wave their feathery arms around a lot to get enough water and plankton through their filters. If you're hitched to something that's constantly moving from place to place, you just hang out the feather filters and let the water pass through. Major conservation of energy.