(Obviously a topic too large to deal with in one post, so consider these some initial musings on the issue)
There is a difference between the origin of fat discrimination and the current basis for fat discrimination. The former would be impossibly difficult to quantify. A lot of theories can be offered, but none will ever be completely sufficient. How our culture morphed from one that was relatively open minded about body image with a noted preference towards relatively fat bodies, into one which prised thinness above all else is just not an easy question to answer. The advent of corporate consumerism and popular culture certainly have sped the change, but why did it change in the first place? It could well have just been the whim of a handful of cultural decision makers 100+ years ago.
What is easier (though not easy) to consider is what fuels fat bigotry today. Again, though, the answer will be complex. Inevitably, nearly all fat bigotry falls back on an arguement that fat people are unhealthy and therefore it is okay to hate them. Indeed, the bigotry and discrimination is "for their own good". I don't doubt that many who harbor fat bigotry internally consider this a sufficent explanation. Yet, factual evidence does not support the consequences. Even if the most flawed studies were completely true (and they aren't) the health impact of fatness is shockingly little given the extreme lengths to which fat bigotry and discrimination exists. There simply is no useful comparison to draw where another group is so severely disenfranchised due to health concerns. Indeed, there are much graver health concerns which elicit little more than a collective shrug from our society.
Morality clearly plays a major issue. Fatness is seen as immoral. A fat body is considered sufficent proof of immorality and this fuels the considerable hate and venom directed towards fat people. Here, though, I don't think morality and religion can be seen as the same thing. Fat bigotry clearly transends religion. These deeply held moral condemnations are seen in Christians, Jews, Athiests, and so many others. Part of this sentiment results from the idea that fat people, by definition, engage in immoral activities. Again, this is without proof, yet it has been diefied as "common sense" in our culture. However, I think these ideas simply open the door to a the notion that our bodies are immoral due to their being aesthetically displeasing. Clearly, our culture responds to beauty as a moral virture, so the backlash against what is culturally unattractive is related to that. But unlike negative feelings towards those who lack conventional attractiveness, there is much social justification to actually act on those feelings when directed towards fat people. It is okay to hate someone for not looking attractive, but there are cultural inducements that say it is okay to hate people. Whether through open prejudice or demeaning pity. There are several factors working together to provide the fuel for fat discrimination. No one factor would be entirely sufficient on its own, but together they have dire consequences for fat people. It is a bigotry which adapts to many different backgrounds and ideologies. Conservatives condemn fat people as a matter of personal responsibility. Liberals blast us for our presumed overconsumpsion. Christians denounce us as gluttons while socialists offer self-righteous pity for our being victimized by corporations. The specific internal logic of individual examples of fat bigotry is remarkably fluid which makes it exceptionally hard to combat.