Its true that Fascism and Bolshevism (aka: Communism) are ideologically opposed. Because of this fundamental ideological conflict, the Nazis and the Communists could never be friends, and they certainly couldnt become Allies. But thats not what the Molotov-Ribbentrop Pact was really about.
The M/R Pact was Germany's attempt to prevent 1914 from repeating in 1939. In 1914, France, England, and Russia had all mobilized on both of Germany's borders. Because of this, Germany was forced to divided its armies to cover both its borders. This proved problematic, especially for the developing Marne Campaign. By signing the M/R Pact, Nazi Germany guaranteed Soviet neutrality in the coming war with France and England. In exchange for peace, the Soviets were allowed to redraw the borders of Eastern Europe to their liking.
However, this did not mean that Hitler and Stalin were allies. Both the Soviets and the Nazis believed that their national ideologies fundamentally opposed the other. To say it another way, it was understood that the M/R Pact was an unnatural alliance between two nations which should otherwise hate each other. And instead of forming a tighter relationship, as the Americans were at the same time doing with their British quasi-allies, both the Germans and the Soviets plotted for inevitable war with other.
Thus, the M/R Pact was not an alliance, but instead a postponement of the reckoning between the two powers.
To expand on the excellent answer by /u/BeondTheGrave, I recently did a little bit of research on the Molotov-Ribbentrop Pact and how it was viewed.
The pact itself was more of a strategic alliance, if at all, and calling them allies is a bit of an exaggeration. The reason for that is clear: Hitler never really did like the Soviets. As Hitler said on 25 June 1940:
The war in the west has ended. France has been conquered, and I shall come, in the shortest possible time, to an understanding with England. There still remains the conflict with the east.
Another interesting quote is one accorded to Hitler on 2 June 1940, where he says "If England, as I expect, now gives up and is prepared to make a reasonable peace, then finally I will have my hands free for my really great task: the conflict with Bolshevism".
This reinforces the view provided by /u/BeondTheGrave in that it was nothing more than Germany's attempt to avoid repeating 1914. The Soviets were constantly looking to consolidate their holds in Eastern Europe to gain leverage, over the protests of Hitler (though in many cases, these were not covered by treaty so they weren't violating agreements, Hitler merely felt threatened). The inevitable conflict was clear to them both, and the strategic resources the Soviets took control of very quickly in areas like Finland made the Germans nervous and lowered their own ability to use those resources.
They weren't so much allies, then, as friends of opportunity.