I'll side with those who suggest that he's bored with a lack of challenge in his class. My younger brother was like that--ran away from kindergarten every day, put tacks on the teacher's chair, failed at almost everything--definitely not the school's image of the gifted child, even though my big brother and I were the star-student-teachers'-pets of the school. They must have figured that this one was from the shallow end of the gene pool.
Then one day, my mom's friend was supposed to do an IQ test on me as an assignment for her college psychology class. I happened to barely have the sniffles that day; so although I protested and begged to do the test, my mother (in her quiet wisdom) sent my younger brother instead. His score was off the charts, and the school finally agreed to put him in the gifted program by the next week. I still think he's the most brilliant member of our family.
On a similar note, when the little boy I was babysitting was tested for giftedness, he failed because he either skipped the math questions or put down totally ridiculous answers. His parents, knowing that he'd shown signs of mathematical genius since he was 2, asked him why in the world he'd done that. He said that the questions were too easy and that he just couldn't be bothered with them. The parents were understandably frustrated and kept trying to convince the school that their son needed more challenge. Two years later, the school finally relented and allowed him into the gifted program. Last year he completed his master's degree at MIT.
Don't give up, and don't head for the drugs too quickly. Do your best to feed his intellect and curiosity outside of the classroom, and never let him doubt that you love him. (I highly recommend the book "The Five Love Languages of Children" for that last note--it will help you with ways of stimulating his attention, too.) Hang in there!