Though scientists have not found the "smoking pig," as one person put it, Wired reports that at least some scientists seem reasonably sure that its fast mutation was the result of factory farming practices:
Scientists have traced the genetic lineage of the new H1N1 swine flu to a strain that emerged in 1998 in U.S. factory farms, where it spread and mutated at an alarming rate. Experts warned then that a pocket of the virus would someday evolve to infect humans, perhaps setting off a global pandemic.
The new findings challenge recent protests by pork industry leaders and U.S., Mexican and United Nations agriculture officials that industrial farms shouldn’t be implicated in the new swine flu, which has killed 176 people and on Thursday was formally declared a pandemic by the World Health Organization.
“Industrial farms are super-incubators for viruses,” said Bob Martin, former executive director of the Pew Commission on Industrial Animal Farm Production, and a long-time critic of the so-called “contained animal feeding operations.”
It's worth mentioning that factory farming gets a huge boost from US crop subsidies [pdf], since the largest input in raising animals is the food necessary to feed them. Obama has claimed to be against farm subsidies, but in reality his call to end $100 million worth of them is nothing compared to the tens of billions that the federal government spends every year to subsidize big agriculture, the meat industry, and fast food restaurants. When you think about it that way, swine flu is actually one of the more benign outcomes of farm subsidies.