The staff members seem to have it right on both counts - I've not found anything suggesting direct sales are per se illegal : at least, not in absence of other legal orders or bylaws (not directly comparable, but this might be relevant or entertaining, and suggests additional action would be required to prevent selling outside, or close to, schools).
But they also seem to have it right on the other count, and it looks like you were aware of this when you picked the "harassment" tag at first posting (unless you thought they were harassing you, which they're not as they would have no interest in you if you went away). Since the staff at the school have asked you to move on, going back would give grounds for seeking a formal injunction which, if breached, could result in criminal prosecution, and may have direct criminal consequences under the Protection from Harassment Act 1997.
[Side note : If you'd been looking at (1A) (c) (i) and thinking the school staff had been doing that, it would be worth considering which law you believe entitles you to conduct marketing outside school gates. It's only an entitlement if it's recognised in law.]
You'll probably correctly argue that harassment would only be a legitimate complaint if it led to someone feeling "distressed" or "threatened" (also "humiliated", but I don't think that would be as relevant here). Since courts are likely to apply a "reasonable person" assessment, it's worth considering why someone might feel distressed or threatened : for teachers and many parents who saw someone waiting outside a school and asking for an opportunity to spend time (possibly unsupervised) with children, their first thought is not going to be "oh look, a tutor", and I don't believe any parent would want their child to attend a school whose staff took that explanation at face value. This is why the school staff suggested it was inappropriate.
In response to your comment above, the idea that some people may not have felt distressed or threatened is unlikely to be an effective defence if others did.
But until a complaint is made or an injunction sought, it looks like there is nothing definitive that would prevent you marketing your tutoring business by becoming known as "that bloke who was reported to the police for hanging around outside the school gates". This is in no way legal advice, but it appears that as things currently stand you're free to explore the effectiveness of this marketing strategy.
[Note : It's occurred to me that you might be a woman, that fewer people might feel threatened, and that this might have made the apparent problem less obvious. Legally and practically there should be no difference, but let me know if I should correct the terminology or go gender neutral.]