Perhaps she needs a teacher who will be more firm with her. My youngest is quite a challenge to her teachers and always has been. She tends to run all over the less experienced teachers, but is absolutely fine with more experienced teachers. I have also noticed that once a child is labeled "bad," that's how they act. Since you know it's possible for your child to behave in class (since she is okay at home and in day care, it's clear she understands and can follow directions), give her a stern talking to before she goes to school in the morning. One thing that worked for me with my daughter was to tell her that if her green card was pulled, she would go to bed 1 hour earlier. If the yellow card was pulled, she would go to bed another hour earlier. If she maintained her green card all week, we would have some kind of treat on Friday afternoon. Well, after going to bed at 6pm for a few nights, she got the message and started behaving. Now she's thrilled to go for a treat on Fridays to celebrate her good week.
HOWEVER, the entire burden of a child's behavior cannot be placed on the child and parent. A big part of this is the teacher keeping the child under control. You send the child to school ready to learn, and the teacher needs to do her part. It's not enough just to complain about how bad the child is being - the teacher needs to make sure she's meeting your child's needs as well. If the teacher is unable to do that, maybe you should ask for a new teacher. Make it clear to your child's teacher that it is up to the teacher to enforce discipline in the classroom - you've reinforced the rules and your child is able to follow the rules elsewhere, so what happens in the classroom is up to the teacher. Also make it clear that you will not stand for your child being labeled defective, since that is simply not the case - again going back to the examples of daycare and at home.
My last thought is this: have you had her eyes and ears checked? My daughter was having problems seeing. After we got glasses for her, her behavior was so much more consistent. I think she feels so much better all around now that she can see properly! Maybe your daughter acts out because she can't see or hear as well as she needs to?
When you ask your daughter about her behavior, what does she say? Does she have any ideas about what might make her behave properly in class?