To remove what could do harm before letting a thing through. Sanitising is a judgment about danger made in advance.
Latin sanitas (health, soundness), from sanus (healthy); to sanitise was first to make healthy, and only later, in computing, to strip out whatever in an input could do harm before it is let through.
Removing what could cause harm before letting a thing pass — a judgment about danger made in advance and applied every time, not case by case.