While it does sound retarded on the surface, the reasoning behind it is to protect the employee and the store.
The crook may have a knife, a gun, or just beat the hell out of you. The company doesn't want to be responsible for your injuries or the criminal's. If it happens on their property, they are liable. and could be sued by either party.
My question for him is did he say anything to the guy like, "Excuse me sir, mind if I take a look at your receipt? Sorry, but it's standard procedure when the alarm goes off." That may have avoided the situation, or at least given him a leg to stand on when Wal-Mart fired him for getting punched.