A Christian teacher has lost her High Court challenge after being dismissed for telling pupils that being LGBT was a sin.