Medical malpractice tort reform (generally supported by Republicans, high chance of passing) is a much higher priority for the AMA than expanding socialized medicine (generally supported by Democrats, low chance of passing) is. The AMA also strongly opposes a single payer national medicine system. They were one of the biggest opponents of Hillarycare during the Clinton years because they realized the implications of a single payer system. That's why their donations are a balancing act that often leans Republican. That helps them with tort reform, staving off a single payer national system, and tosses quite a bit to the Democrats in a bid to expand services.
Their support for socialized health care is limited to expanding social programs that pay for medical care for those that currently don't pay (children, the indigent, illegals, etc) and those that can't afford to keep paying (people with crappy health plans). This increases their take by having the government pay them for people they're not getting money from now, keeps their current funding sources from private insurers, and minimizes the risk of increased government control.
Just take a look at Hillary's "evolution" on health care issues. She transformed from the health care system's #1 enemy in 1994 into one of the top recipients of funds from them in 2006.