You're a wise and perceptive father to see this problem now and want to change it. When your daughter is a pre-teen and teen, she'll be more heavily influenced by her peers and you won't have nearly as much influence. If you build a strong bond with her today, you can save both of you much heartache in the future. If there's mutual love and respect between the two of you, she'll want to please her daddy. When it's time to date, she'll reject guys who treat her poorly because she has a father who holds her in high regard.
There may be an unhealthy dynamic at play here with your daughter and wife teaming up against you. Pay close attention to what your wife is doing and saying (consciously or unconsciously) that makes your daughter perceive mom as the good one and you as the meanie. Is she babying your daughter, always siding with her, or over-empathizing with her feelings rather than presenting a unified front with you? If that's the case, the two of you should take parenting classes together so you get on the same page. The investment of time today will pay off in a big way as your daughter grows older and potential problems are much weightier.
You and your daughter should do a weekly activity together without your wife. This sacred father-daughter time could involve taking a hike together, riding bikes, going fishing, taking taekwondo classes, or doing whatever you think will strengthen the connection. A 6-year-old girl will be utterly enthralled by this special one-on-one time with her dad and it will make her feel cherished.
As for what happened at the school, it's important to keep in mind that these kind of events are new to little kids. They often don't know what's expected of them unless parents communicate it in advance. After all, your daughter has only been on this planet for six short years! Before you attend an event at the school, at church, or in the community, talk to her about what to expect and how she should behave. If she's disruptive, tell her that you'll remove her. Then (most importantly) follow through by taking her by the hand, escorting her out of the building, and going home.
With conscious parenting, though, the aim is to prevent situations like this from happening. I can't recommend enough that you read “The Conscious Parent” by Dr. Shefali. It will make you look at your parenting journey in a whole new light. As Albert Einstein said “No problem can be solved from the same level of consciousness that created it” and this is certainly true with parenting.