No, it'a not done to gut workers rights. The workers are still employees, of the franchise owner. It is done because expanding through franchises is a lot quicker and less risky than expanding company owners stores, because someone else puts up the capital and assumes the risk of failure.
There's also the point of view that the franchisees are in the burger flipping business (and employ burger flippers), while Mc Donalds the parent corp are actually in the real estate business. (It's not _entirely_ true, but it's a quite plausible explanation of how their business works...)