Nothing illegal here (at least not on Walmart's part). They're allowed to detain shoplifters while they await the arrival of the police. Now that you have been cited, it's really out of Walmart's hands. It is society that is harmed by your criminal activity and it is the state that prosecutes you. You need a lawyer.
You can count on receiving a letter from Walmart's "lawyers" making a civil demand for the damages you have caused them.

