The social and political divisions between Austria and Hungary stretch back to before World War I. The area that is today Austria was a part of the Austro-Hungarian empire, like modern Germany was a part of the German Empire. These two countries were close, but part of much bigger world powers.
If we look back to the end of World War I, the Bulletin of International News stated "the Treaty of Versailles (Article 80) and the Treaty of St. Germain (Article 88) laid down that the independence of Austria was inalienable except with the consent of the Council of the League of Nations."^1 These agreements were merely a starting point. Over the next few years, other agreements were established. Italy, France, and the UK agreed to "take a common view as to the necessity of maintaining Austria's independence and integrity in accordance with the relevant treaties," a sentiment that was expressed both in February and September of 1934.^2
Subsequent official treaties reaffirming or strengthening Austria's status were signed. The article in the Bulletin succinctly denotes the treaties, I recommend reading it for a better understanding of the agreements present and the timeline behind them.
I cannot speak to the internal politics of Austria, but the international desire for an independent Austria was enormous. "Sir Austen Chamberlain [Britain] on April 1, 1936: 'The independence of Austria is a key position. If Austria perishes Czechoslovakia becomes indefensible; then the whole of the Balkans would be subjected to a gigantic new influence. Then the old Germanic dream of a Central Europe ruled by and subject to Berlin would become reality from the Baltic to the Mediterranean and the Black Sea, with incalculable consequences not only for our country but our Empire.'"^3
This was said in 1936, and we should assume that the idea of the Third Reich spread across Europe became more of a concern once the second World War began. At the conclusion of the war, the free Austrian state had been part of the world canon for almost a quarter century. They would have been removed from Nazi control, and there was no reason to recombine Austria and Hungary.
1.) "Austria and Germany," Bulletin of International News 15, no. 5 (March 05, 1938): 16, accessed January 19, 2015, http://www.jstor.org/stable/25642221.
2.) Ibid., 17.
3.)Walford Selby, "Austria before the Anschluss and a View of Her Future Prospects," International Affairs (Royal Institute of International Affairs 1944-) 21, no. 4 (October 01, 1945): 477, accessed January 19, 2015, http://www.jstor.org/stable/3018345.
*Edit: formatting
While /u/CptReynoldsSC highlighted some of the more recent, international law reasons for the division of Austria and Germany, the division was only enforced by these measures. The cultural and political division of Austria and modern Germany happened way before this, when Prussia and Austria struggled for control over the forming modern Germany. I will quote a post by myself as a short introduction until someone else with a better grasp of the whole thing can contribute a more thorough insight.
This question was the centerpiece of a huge debate at the time of German unification - the debate between the "kleindeutsche Lösung" (~small Germany solution) and the "großdeutsche Lösung" (~large Germany solution). "Small Germany" being Germany unified with Austria left out, and "large Germany" being Germany with Austria included.
The root of the conflict stems from the upheaval brought by the Napoleonic wars that dissolved the Holy Roman Empire (of the German Nation), the former overarching political structure of the German region. The Austrian Habsburg dynasty had controlled the HRE for a long time and wasn't willing to let it go completely, so they pretty much retained the title of Emperor for the state of Austria-Hungary itself.
Now, at the Vienna conference after the final defeat of Napoleon, the victors decided on a new political structure for Germany: The "Deutsche Bund" (German Confederation). In the German Confederation, Prussia and Austria were the leading powers with Austria being the nominal head of the confederation.
This is where a lot of the controversy stems from: Neither of the powers was being ready to submit to the other, a conflict that would cumulate in the "German War" (as it is called in Germany, while it's called Austro-Prussian or Seven Weeks War in the rest of the world) of 1866. Now, Austria was not without allies in Germany proper: Most of the "middle states" (medium sized states sandwiched between Prussia and Austria, such as Saxony or Bavaria) were fearful of Prussian expansion and sided with Austria in hopes of support. The "big Germany" solution thus was the solution in which Austria would retain the lead in Germany and grant extensive federal rights.
The Prussians on the other hands favored a more centralized approach and weren't all that much for extensive federalism, founding the "Zollverein" (German Customs Union) in the early 1830s. This Union was primarily aimed at standardizing weights, scales and such and lifting customs at the borders of member states, making transportation of wares and trade in general much cheaper and easier. But it also cemented the Prussian hegemony over the member states, since the Prussians gained extensive rights and the member states had to give up important state rights, becoming client states in all but name.
Also not helpful was the problem of Austria not being only Austria, but Austria-Hungary. Austria-Hungary was by no means Austria with Hungary as a nice little vassal, but rather a personal union. The Hungarians had gained extensive rights in this union over the time and were not without say in it. Also, Hungarians were not German and were not included in the German unification movement or forming German nationalism. Proponents of German unification with Austria included always retained that Austria would have to dissolve the personal union and leave Hungary excluded from Germany. But Austria was not really ready to just give up the larger part of their territory, just to become leader of a Germany that they considered to already control via the German Confederation anyway.
So, Austria was not really invested into the whole German unification thing anyway. And while Prussia wasn't really either, the King of Prussia vehemently refusing to become German emperor (even though being offered the crown by representatives of the 1848 revolution), Bismarck saw in the growing unification movement a perfect vehicle of ensuring Prussian hegemony over all of Germany and of defeating the ancient rival Austria once and for all.
Thus Bismarck stood behind the "small German solution" and pushed for it, leading to the German war (/Austro-Prussian war) and the exclusion of Austria from the unified Germany.