Taxpayers will foot the legal bill after an alleged pedophile ex-teacher had all charges of abusing boys thrown out because of her gender.