You point to two pretty important reason why lawyers continue doing what they do, and why the career path remains attractive compared to engineering, even if lawyers ultimately earn less.
1 - In general, as a lawyer, your perceived value goes up over time (gray hairs are money-makers). Whereas, in general, as an engineer, your perceived values goes down over time.
2 - A lawyer has a sense power. The legal field requires them to be independent (they are beholden to their clients, but not anyone else) and also knowledgeable on how to navigate (or manipulate) the system of rules that society has put in place. This provides some sense of power and agency. Today, even though many engineers probably "know" more about how individuals or society is manipulated, they generally work for major companies, and even those that do not don't have the incentives to properly bring such injustices to light.
If engineers were somehow incentived (i.e., make money) from outing perceived technical injustices, I suspect they would quickly eclipse lawyers in both compensation and stature.