I agree it sucks to lose your job that way, but look at it from the companies point of view. You'd do it too if you were boss. That is what business is about, make money.
At my last job my main resposablility was to train unskilled labors to be welders so the company wouldn't haved to pay the high dollar welders want as pay per hour. It sucked having to tell welders with 10 years or so experence that the pay was only $9.50hr, they would just laugh. But I could take a high school recent grad and have a welder made out of them in 3 weeks for that low pay, and they'd be happy about it.