According to John Thorn, the official historian of Major League Baseball, it goes back to the earliest days of the game. Back then, the person known as the manager was the business manager, the guy who kept the books in order and the road trips on schedule. Meanwhile, the guy we call the manager today, the one who arranges the roster and decided when to pull a pitcher, was known as the captain. In addition to managing the team on the field, he was usually also on the team as a player. For many years, the “manager” wore a player’s uniform simply because he was a player. There were also a few captains who didn’t play for the team and stuck to making decisions in the dugout, and they usually wore suits.
With the passing of time, it became less common for the captain to play, and on most teams they took on strictly managerial roles. Instead of suits proliferating throughout America’s dugouts, though, non-playing captains largely hung on to the tradition of wearing a players’ uniform. By the early to mid 20th century, wearing the uniform was the norm for managers, with a few notable exceptions. The Philadelphia Athletics’ Connie Mack and the Brooklyn Dodgers’ Burt Shotton continued to wear suits and ties to games long after it fell out of favor (though Shotton sometimes liked to layer a team jacket on top of his street clothes). Once those two retired, it’s been uniforms as far as the eye can see.
The adherence to the uniform among managers in the second half of the 20th century leads some people to think that MLB mandates it, but a look through the official major league rules doesn’t turn up much on a manager’s dress. (via Why Do Baseball Managers Wear Uniforms? - Mental Floss)


