I am not sure if I understand your point correctly. Are you implying that clients only hire beginners on UpWork?
I am hiring there and I certainly have to pay way more than $5 per hour. My experience is that the price for software development starts at about $25/hour. That is for a student with a little bit of experience and rather low morale. Devs with actual work experience start at about $50 per hour. Again, morale will be kinda low at that price. For a really smart, motivated dev with a lot of experience, you have to pay more.