The key phrase here is "then they will be taught it" - and the key word is the modal verb "
WILL." The inspector isn't saying that if we don't learn to be nice then we
should suffer, or that we
might suffer, he's saying that if we do not learn to live together then we
will be taught the lesson. Essentially he - and Priestley - are saying that if we don't learn to work together then society will
inevitably fall apart.