They can refuse entry to anyone, at any time and they do not need to give a reason. When I do this at work, I purposely don't give a reason as when you do you either open yourself up to accusations of sexism, racism etc which would indeed be against the law, or arguments over whether they think your justification is valid or not etc etc.
If someone where to accuse you of these things, the burden of proof would fall on the accuser.
Contrary to popular belief, unless there is a designated public right of way (such as a public footpath through farmland), everytime you set foot in a shop, theme park etc you are doing so by invitation. So if you walked into your local Sainsburys and a Manager decides to ask you to leave without giving you a reason, your permission to be on those premises has been withdrawn and by refusing to leave you are trespassing. They don't need a reason as you have no right to be there in the first place. A closing time is effectively them removing their consent for you to be there after a certain time.