You know that scene in Rounders when Worm just can't stop dealing from the bottom of the deck, despite winning more than enough money to accomplish their goal? That's how the Red Sox got caught.
"In the series in Boston, the Red Sox were 9-for-24 with runners on second and/or third, but in the teams' first 12 meetings this season, Boston was just 7-for-88 with runners in scoring position."
Stealing signs is not against the rules of baseball, nor the code, though relaying them to the batter via voice will get you or your batter plunked.
But using unapproved electronics in the dugout is against the rules and when you were as effective against one team as the Red Sox were, people are going to start looking for how you're doing it. There are too many cameras in baseball to think you're going to get away with it for long, so your best bet is to do just enough to have a slight advantage, but not so well that people start looking.