The transfer sit-out rule used to apply only in football and basketball. It was applied to baseball somewhere around 2009, the same time they adopted the 25% minimum rule.
The stated justification was that baseball had a lower graduation rate than many other sports. The problem with that was, it didn't weigh the 3rd year draft eligibility into the review of that issue; it blamed transferring for it, really without a lot of evidence.
The reality is that in a world where coaches can come to you in June and tell you that your money has been reduced or even eliminated for the next year, players need to have the ability to shop around to protect themselves. True, the NCAA has since allowed schools to provide 4-year guarantees on money, but the NCAA has not REQUIRED that the guarantees be given. As of now, the "Power 5" conferences have a rule making 4-year guarantees automatic, but at the hundreds of other D1 programs, you had better speak up and ask for it, or you won't get it.
Imposing the sit-out rule in baseball was a disgraceful error and I hope the NCAA reverses the mistake at long last. But given the NCAA's track record, I won't hold my breath.