Software Engineers make a lot of money because their contributions have the potential to affect a lot of people.
Comparably, a nurse may have a positive impact on a dozen lives over the course of a week. A programmer's contributions may affect thousands or millions and the positive effects compound over time. Even if it takes longer (comparable to other jobs) to accomplish anything meaningful.
Many developers don't overcome the communication barriers with users to realize the impact their work has.
A task that could take somebody 5 hours a month can be automated to take 5 minutes with a program. Package and sell that program to thousands of users and, in terms of reducing operating costs, the software is a cash cow for any business in that domain.
Devs love to get caught up on theoretical minutae, CS fundamentals, testing coverage, methodologies, axe grinding over subjective preferences for frameworks/styling, etc.
None of that matters. Your value is literally measured in your ability to enable others to earn money or save money.