Headlights stay on when I have turned the switch to "off." Why? on 2007 Hyundai Sonata

My headlights will sometimes stay on even though I have turned the switch to the off position. If I turn the switch to the "auto" position the lights will sometimes go off. There are times when I have to turn the switch in both directions several times before the lights will actually go off. This happens daily. I have had my battery go dead twice because I didn't realize my lights were still on when I left my car during the day. What could be going on??

Asked by for the 2007 Hyundai Sonata