It is just a matter of legislation. You cannot expect "good will" from a company because this is not how capitalism works.
And even if I think that it is right that laws allow companies to fire people when they need it, it should never be easy or cheap. Being able to fire at will makes a nation of slaves that must always obey their employers unless they want to risk themselves to loose everything.