As with most sports, undoubtedly much of the reason is historical. It wasn't to suppress innovation, but actually as a result of it; for most of swimming history, "freestyle" was always where the innovation occurred (hence the name, meaning you could do whatever you wanted stroke-wise) and the other strokes were to preserve specific strokes that otherwise would have been lost to that innovation. The quotes below are from this Washington Post article.
The Breaststroke was the first swimming stroke in modern Europe, written about in the sixteenth century, and undoubtedly is part of the games for that reason; until the 19th century, it seems to have been the primary stroke, and was the main stroke used in early 19th century competitions.
By 1837, when modern competitive swimming began in London, several indoor pools already existed. The National Swimming Society regulated competition. The breaststroke and the recently developed sidestroke were used.
The other strokes developed from these for the most part. The sidestroke gave way to the front crawl, though it's unclear why the sidestroke didn't persist but the breaststroke did (I'd guess probably because the breaststroke had been around for centuries, and the sidestroke hadn't, but it's just a guess). The front crawl itself had been practiced thousands of years ago, but wasn't a thing in Europe at the time; it had, though, been remembered by other cultures, such as the Native Americans who medaled at a competition using a form of crawl:
In 1844, Native Americans swam in a London meet. Flying Gull swam 130 feet in 30 seconds to defeat Tobacco and win a medal. Their stroke was described as thrashing the water with their arms in a motion "like a windmill" and kicking in an up-and-down motion. This early form of the front crawl was successful in that race, but the English continued to prefer the breaststroke for competition.
The Butterfly evolved directly from the breaststroke, as an attempt to improve breaststroke performance. It was made illegal during breaststroke competitions, but was made its own stroke in competition:
Even though the butterfly breaststroke, as it was called, was faster than the breaststroke, the dolphin fishtail kick was declared a violation of competitive rules. For the next 20 years, champion breaststrokers used an out-of-water arm recovery (butterfly) with a shortened breaststroke kick. In the late 1950s, the butterfly stroke with the dolphin kick was legalized as a separate stroke for competition.
The article doesn't mention why backstroke is its own event, and I can't find an explanation, so I won't guess, other than to note that it's a popular stroke among the less fit, given its ease when not swimming competitively.
Ultimately, it seems likely that the breaststroke and the butterfly, at least, exist in competition because that's all there was in competition originally; and then later, the breaststroke became a specifically mentioned stroke (as opposed to "freestyle", which now just means the crawl) presumably to protect those swimmers who enjoyed success at the breaststroke once the crawl was introduced to competitive swimming (and clearly far superior, speed-wise). The butterfly was presumably made a competitive stroke for the same reason - to allow people to do the interesting new stroke without affecting the breaststroke competitors who wanted to do it the traditional way.