By all accounts, Stalin was one of the most paranoid world leaders of the twentieth century. I find it a little difficult to swallow the idea that a man who was terrified at the prospect of his fellow countrymen bringing down his rule enough to institute large-scale purges would uncritically trust a German dictator who came to power on a wave of anti-communist sentiment and whose economic policies were in opposition to Stalin's own. I'm also not entirely convinced that Stalin had a great deal of respect for Hitler, as a person, either, if only because just about the only thing they did have in common was a skill at persecuting and killing large numbers of people. As evil as both men were, I do tend to cling to the idea that their personal philosophies were a little more complex than simply inflicting indiscriminate mayhem on the world.
But I think Kaiser Kris is right on the money. Stalin assumed that Germany and the USSR would inevitably come into conflict, he just didn't realize it would happen as quickly as it did. And, honestly, he probably had a point. In 1939, it seemed extremely unlikely that the Nazis would have rolled through western Europe as quickly as they did. Even after the fall of France, Stalin probably assumed that a stable, well-balanced leader would have taken time to regroup and rebuild, giving the USSR a chance to prepare for attack. I mean, yeah, it retrospect it seems ridiculous to assign stability and balance to Adolf Hitler, but, well, hindsight is 20/20 and all....