It's STOL so it can work with smaller carriers, because the Marines insisted (they don't like being dependent on big Navy carriers for ground support flights, because sometimes they're not there). If it were just how many could fit on a regular carrier, they'd want them as small as possible instead of adding bulk and weight. And that would be fine except that adding the STOL equipment makes the plane bulkier (bad for stealth), heavier (bad for speed), and less maneuverable (barring vectored thrust tricks which sacrifice speed).
The Harrier was and is an engineering masterpiece, but it's still complicated to maintain, difficult to fly to its full potential, and neither stealth nor high speed were in its design goals. It's good at what it's meant to be, but it's not intended to be all things.