In both cases, the rule breaking was an attack on the actual integrity of the system. In the case of the Astros, we’re not talking about using PEDs, which have a passive effect on all player actions—we’re talking about an active attack on gameplay as it happens. In the case of Trump, we’re not talking about a guy taking bribes from a government contractor. We’re talking about an attempt to monkey with the results of the next election.
And in both cases, if you were really determined to do it, you could come up with some excuses:
It wasn’t just the Astros. (Or Trump.) Everyone was doing it.
The rules about sign stealing (or influencing elections) aren’t as cut and dry as they seem. You could interpret them lots of ways.
You can’t prove to a metaphysical certainty that the sign-stealing was why the Astros won the World Series. Or that Trump’s holding up of aid actually changed anything with regard to Ukraine.
The governing body has total discretion with how to deal with this. Major League Baseball—or the U.S. Senate—can do whatever they want. This is a political, not a legal, process.