Though note that Tor is also vulnerable to someone who doesn't control a majority of nodes, but can monitor the traffic of a majority of nodes from upstream. This is probably easier to achieve for a global adversary than actual control of the nodes' computation.
This doesn't make it bad software; it's the best we have, and being able to monitor traffic across the entire Internet is a huge ask of an attacker.