Your classmate made the mistake earlier (in the past) but your classmate is still wrong in the present. Thus, you can say either sentence. Why were you wrong? asks about the past mistake. Why are you wrong? asks about the classmate's present state of being wrong.
As for 'The bar magnet is moved back and forth', this is present tense. But is moved back and forth is a passive construction. This is different from the active construction 'The bar magnet moves back and forth'. The past simple of your sentence would be 'The bar magnet was moved back and forth' (passive) or 'The bar magnet moved back and forth' (active).
If you don't understand the difference between an active construction and a passive construction, you might want to check out The English Club's pages about the subject.