I’ve worked for and with people who made a lot more than me.
So what? They achieved that by doing something I didn’t. They may have also made sacrifices I didn’t. Doctors certainly busted their ass a LOT more than me - I could never do what they do in educational terms alone (not to mention the biological stuff).
Did you really get to being a nurse without knowing typical salaries for different types of nursing or different kinds of doctors?
Now to answer the real question: how to not be bothered by this. Start by changing the idea in your head that your work has the same value as the work of someone else, let alone someone who spent years more time studying than you did, and also took on a lot more debt to do so, and a lot more risk.
Go read “Your Erroneous Zones” by Wayne Dyer. It’s an intro to the methods of CBT (Cognitive Behavioural Therapy) - these thoughts of yours are “scripts” that aren’t useful for you. He teaches how to change thinking such as this.