It was the middle of July, and the race to represent Indiana's 36th district in the state senate was heating up. Incumbent Brent Waltz, an investment-banking Republican known for his fiscal conservatism, faced a challenge from Mary Ann Sullivan, a Democratic state representative who has helped launch several charter schools.

Then, something unexpected happened.

Faced with the choice of endorsing the Republican businessman or the school-savvy Democrat, the Public Action Committee of the Indiana State Teacher's Association (ISTA) endorsed Waltz.

While the move by the state's teachers' union turned enough heads to make it seem like a rare occurrence, both national and local teachers' unions have recently made endorsements and donations to some Republicans who speak and vote against their values. The GOP nods mark a divergence for the unions, which are typically among the largest Democratic donors.

"While their decision to rebuff Sullivan is unsurprising, their decision to actively support Waltz is," ISTA member and teacher Tina Ahlgren wrote in a blog post. Ahlgren speculated that Sullivan lost ISTA's support when she sponsored a teacher accountability bill, but she noted that Waltz had supported more policies at odds with those of ISTA, such as school vouchers and funding cuts.

But Waltz hasn't been much involved in Indiana education policy. Instead, he's spent much of his time advocating for gun rights, banning gay marriage and training state police to seek out illegal immigrants. Waltz's business record also runs counter to the teachers' union's mission to protect laborers. In 2009, Waltz's company didn't pay into the unemployment fund for its workers.

"In the last legislative session we believe that he supported some of our issues in caucus and he definitely sat down with our lobbyists and listened to our concerns," ISTA president Nate Schnellenberger told The Huffington Post Wednesday, but said he didn't "want to get into specifics on which issues."

Unions are often quick to scrutinize the funding streams of their rivals. A union-backed New York organization recently dubbed the nonpartisan group StudentsFirst, led by former Washington, D.C. Public Schools chancellor Michelle Rhee, "RomneyFirst" -- based on the affiliation of a few board members and endorsements in several states.

But while teachers' union chiefs opine on the importance of social justice, tolerance, workers' rights and abortion rights, similar scrutiny shows that in recent years, national and local affiliates of the National Education Association -- the nation's largest teachers' union -- have endorsed candidates who disagree on all those counts. Since 1989, five percent of campaign contributions by the NEA have gone to Republicans, according to public records.

"We are moving away from party affiliation, instead focusing on where these members supporting public education are," Mary Kusler, NEA's advocacy chief, told The Huffington Post. The NEA bases its contributions on the recommendations of state and local chapters and a legislative report card that tracks politicians' votes on education issues. "We are all about the issues," she said.

This also means that the union has supported groups and candidates that call homosexuality and abortion sinful; authored voter suppression laws; tried to classify abortion as homicide; critiqued teaching evolution; and called Democratic leaders like President Barack Obama "Obummer" and socialist.

On July 4, John Stocks, NEA's executive director, gave a rousing speech at the union's national gathering, imploring his members to be "social justice patriots." Stocks took on voter suppression laws, saying "these insidious laws could prevent 3.2 million voters from taking part," and that he is "extraordinarily proud" that the NEA plans to "fight against voter suppression." But in doing so, NEA's members might be fighting against their own endorsees.

Pennsylvania state legislator Rep. Mike Turzai (R-Allegheny) became known for his remark on how the state's voter ID law "is gonna allow Governor Romney to win the state of Pennsylvania." Turzai has received $40,000 from the NEA's Pennsylvania State Education Association since 2006.

Rep. Mike Simpson (R-Idaho) has been endorsed by the Idaho Education Association for the past six elections, and has received $41,000 from the NEA since 2000. In 2006, he voted for a federal photo ID voter law. Kusler, the head of advocacy for the NEA, says the group supports Simpson because of his record on education funding, and "doesn't look at every vote" when making such decisions.

Stocks, the executive director, laid out the NEA's stance on LGBT issues. "Through this association," he said, teachers "took a stand to support equal treatment for same-sex couples." In 2006, Simpson voted to constitutionally define marriage as one man wed to one woman.

This spring, when Alabama considered passing a law that would allow the creation of charter schools, the Alabama Education Association (AEA), the state's teachers' union, attacked the legislation. At the same time, Randy Brinson, the chairman of the Christian Coalition of Alabama (CCA), wrote an email to his group that tied charter schools to Shariah law. "Education policy is one of the major efforts by such radical groups as the Muslim brotherhood to radicalize more secular countries," Brinson wrote. In newsletters to CCA membership, the group has also called abortion and homosexuality "horrible sins."

The AEA donated $2,500 to CCA in 2010, and the AEA's PAC gave Brinson $5,000.

The Tennessee Education Association has endorsed several Republicans, including Rep. Dale Ford, an ALEC member who favors abstinence-only sex education and supported a law that asserts that the Constitution doesn't recognize abortion rights. The Tennessee teachers' union has also endorsed Grady Caskey, giving the Blount County TEA affiliate president $1,000 this year.

Caskey once tweeted: "Welcome to the United Socialist States of America. Thank you Reid, Pelosi and Obummer!"