The problem with properly qualified secondary teachers is probably caused by a number of factors. Some possibilities may be:
AFAIK you need to have a degree in a subject you are teaching at secondary school to be qualified to teach it. This means a teacher with a degree or masters degree in physics would not be officially qualified to teach Mathematics, but probably quite capable of teaching Maths to second level students to a very high standard.
It is very difficult to fire under performing or bad teachers.
We have nothing like OFSTED in this country to make sure schools make the grade. This is partly due to union resistance.
Schools having no money and putting unqualified teachers on because they can’t afford it any other way.