This can happen because, while slavery was abolished in 1865, the 13th amendment has a big loophole that carves out an exception to allow forced labor as a form of punishment - although 4 states recently rejected it.
In other words, McDonald's is a slaver. If you don't agree with slavery, don't patronize McDonald's.