If the company wants all of your ideas, even the ones you come up with on the weekends, then they should offer you a higher salary than the companies that don't demand that time.
As it turns out, many companies do exactly this. And (apparently) their developers decided it was a fair deal. But if you don't like that deal, that's an entirely reasonable choice. In that case, just don't work for such a company, even if they offer better salaries.
It would be unfair to say "don't take the job if you don't like the deal" if there weren't other options, but the fact is that there are lots of other options. There are plenty of software jobs that don't include such clauses, especially in the non-profit and academic sector.
The problem isn't the single employer, it's when every employer does this, and it's your only option, and this is the trend.
So we must resist it at all levels. And again, what you state is actually not enforceable in CA, as our laws protect your personal work. It might in fact be one reason why the valley exists here.
As it turns out, many companies do exactly this. And (apparently) their developers decided it was a fair deal. But if you don't like that deal, that's an entirely reasonable choice. In that case, just don't work for such a company, even if they offer better salaries.
It would be unfair to say "don't take the job if you don't like the deal" if there weren't other options, but the fact is that there are lots of other options. There are plenty of software jobs that don't include such clauses, especially in the non-profit and academic sector.