This is simple. It's Economics 101: Supply and Demand.
1. You work hard to improve yourself and gain more skills that people will want to hire you for.
2. More people will want to hire you
3. Demand goes up, while supply (yourself) is fixed.
4. Your price goes up.
On the other hand, if you care so much about your "life quality" and put absolutely 0 effort to improve yourself outside of work,
1. You don't have much to show other than what you did at current work
2. You are making yourself completely dependent on the company
3. When the company fires you, you have NOTHING to show to others. It's not like you can show people the code you wrote while you were at the previous company (the company owns the code and you're not supposed to share it outside publicly)
4. Since you have nothing to share, less people will get your value and less people will want to hire you
5. Demand goes down, supply fixed.
6. Your price goes down.
You can keep bitching about how the world is unfair and harsh and write some blog post that sounds almost like a beautiful piece of poetry, but that won't change anything, because that's how the world works.
It's not about companies "exploiting" employees by telling the m to work on something during the weekends. It's actually for yourself. If you don't believe that, that's fine, but you will stay a shitty developer and the law of supply and demand will kick in.