In history class, my teacher mentioned that Stalin treated Mao very rudely when he visited the USSR, and was in general quite disdainful of him. Why is this? Was it due to ideological differences, racial bias, or a combination of both?
Thanks!
Modified from an earlier answer
At the formal level, the Sino-Soviet relationship was characterized by a degree of mutual misunderstandings that evolved into suspicions and a general distrust on both sides. With the conclusions of hostilities in 1945, Stalin desired for Mao to continue his wartime collaboration with the KMT and Chiang Kai-Shek. Stalin believed not only would the KMT prevail in a civil war, but that civil war would destroy China. Stalin gave Mao a diktat in August 1945 that he should travel to Chungking and negotiate with Chiang or "his stand would be repudiated in China and abroad." The Chungking meeting had the opposite effect than Stalin intended. Mao's meetings with Chiang reinforced within him the idea that he could win a civil war; Mao would later claim that Chiang was "a corpse and no one believes him anymore."The communist victory came as much a shock to Moscow as to Washington. Although the Red Army turned over some Japanese war material to the CCP, they largely kept the best equipment and destroyed the remainder. Mao's victory emerged as a fait accompli for the newly-formed PRC as the USSR could not repudiate a successful communist revolution.
Mao's 1949/1950 trip to the Soviet Union was beset by a great many difficulties that led to personal friction between the two dictators. The two men were famously prickly, and Stalin's personal behavior towards the end of his life hewed increasingly to the mercurial. However, beyond the personal problems, a good deal of the friction created by the trip was due to the fact that the two parties had very different intentions and expectations for the summit between the two leaders. Mao went to Moscow expecting both direct military assistance against Taiwan and a renegotiation of the 1945 Sino-Soviet Treaty of Friendship and Alliance which the USSR gained a number of favorable concessions from the KMT government. For his part, Stalin was unwilling to budge on the Taiwan issue and reluctant to drastically redraw the treaty. Moreover, the Chinese negotiating team's use of the news that Burma and India had offered to diplomatically recognize the PRC, along with the implication that the rest of the British Commonwealth would follow, as bargaining leverage made the Soviets decidedly uncomfortable. One of the main fears in Stalin's strategic calculation was that Mao was another Tito in the making, and thus more dangerous as Mao had greater potential to strike out on his own than the Yugoslav Marshal.
The details of the resulting new Sino-Soviet Treaty of February 1950 satisfied few parties in either country. The secret additional agreements of the treaty established that the PRC would not allow any other foreign power to manage or set up any enterprises in northeast China save the USSR. From Mao's perspective, he saw this as turning parts of his country into a foreign colony and he contended that the treaty did not compel the Soviets to have similiar restrictions on their side of the border as hypocritical. The treaty's boilerplate language on the rightful government of China concealed the fact that Stalin had explicitly ruled out the use of Soviet air and naval power to help a mainland invasion of Taiwan. For his part, Stalin saw the treaty as essentially proactive measure that guaranteed Soviet strategic interests in East Asia by preventing Mao from making a rapprochement with the West. The boon both leaders got out of the treaty was a global recognition that they were two major world leaders. For Stalin, he was the head of a movement that now had one of the most populous countries in the world under his wing. Mao's alliance with the Soviets meant that one of the world's superpowers had recognized the CCP as the rightful ruler of China and he was a figure of world stature.
Although contemporary American Cold War discourse made much of the Sino-Soviet friendship treaties, the diplomatic agreements between the two powers was tense and riven with contradictions. The Soviets expected that alliances with China would follow the pattern they had set up with Eastern Europe: a series of mutually reenforcing relationships that would chiefly benefit the Soviet Union. While it is tempting to castigate this as Soviet (and by extension, Great Russian) chauvinism, the Soviet's position was that they were the senior partner within the Marxist-Leninist camp and protecting the USSR was by their logic the best strategy for the global communist movement. Racial chauvinism reinforced this logic and made it more difficult for the Soviets to treat the Chinese on an equitable basis. The Chinese on the other hand, were acutely sensitive to any unequal relationship with a foreign power. For many Chinese, the experience of the Western and Japanese informal empires of trade agreements and other disadvantageous treaties made them leery of any treaty that was not equitable. Thus the technological exchanges between the USSR and the PRC were the source of a great deal of acrimony. The Chinese frequently complained that Soviet engineers acted in a boorish manner not unlike that of Westerners prior to the establishment of the PRC. On the other side, the Soviets felt that the Chinese were not paying the actual value of technological assistance. A salient example of this tension is the debate over industrial blueprints for factories and machinery. The Chinese expected industrial blueprints to be provided at cost according to their estimation of the ruble-yuan exchange rate, and the USSR often balked at this. The Chinese then went to the Eastern bloc to resolve this blueprint impasse, obtaining them from the East Germans. The Soviets saw this as meddling within their own bloc and it undermined the Soviet claims to intellectual and developmental primacy within the Warsaw Pact as German engineering was just as capable as Soviet.
The Chinese approach to the Eastern Europe demonstrates another arena in which the Sino-Soviet relationship swiftly devolved into acrimony. Although the Soviets expected Eastern Europe to be a pliant buffer zone of satellite states, in practice the "little-Stalins" had a limited degree of autonomy. Their relationship with the PRC allowed them greater diplomatic and economic support as Mao was ideologically kosher. In both 1956 Polish and Hungarian affairs, the Chinese weighed their options as to whether back the Soviets or the Eastern Europeans. Although they eventually backed the USSR, the Soviet officials resented Chinese interference within the politics of the bloc and Mao positioning himself as the bloc's unifier. Among the non-aligned world, Mao's calls for more radicalized activity were at odds with the Thaw's desire for a more peaceful competition and coexistence with the West. As the relationship deteriorated Mao castigated the leadership of the USSR as rightists and the Soviet officials began to portray Mao as a the head of a corrupt government that betrayed the revolutionary ideals of the Chinese people. Mao's visit to the USSR in 1958 was a much bigger disaster than his 1949 state trip, with the Chinese leader taking every opportunity to grandstand at public state events and claim to be the true socialist man of the people.
Somewhat paradoxically given the two's general distrust of each other, Mao became one of the foremost defenders of Stalin within the Communist sphere after Stalin's death. Mao critiqued Khrushchev's secret speech as a hasty and ill-advised ideological retreat. Although Chinese criticism of the Thaw and destalinization did not openly call for a return to Stalin, it implicitly challenged the ideological purity of the Thaw's reformist leaders. In private, PRC officials portrayed the 1950 treaty as Stalin's creation used the Khrushchev's disavowal of Stalin to pressure the Soviets to revise its security and economic clauses. This public criticism of destalinization and private castigation of Stalin made Soviet negotiators believe the Chinese were two-faced and untrustworthy. Soviet public pronouncements would characterize Maoist agrarian-based ideology as a retrograde step that the PRC took in spite of the advice of the USSR. The increasing cult of personality surrounding Mao also received censure in the Soviet press, especially as the split became more apparent.
In the end, both sides blamed the other for the split and in hindsight, both were correct.
Sources
Jersild, Austin. The Sino-Soviet Alliance An International History. Chapel Hill, [North Carolina] : The University of North Carolina Press, 2014.
Spector, Ronald H. In the Ruins of Empire: The Japanese Surrender and the Battle for Postwar Asia. New York: Random House, 2007.
Ward, Christopher J. Brezhnev's Folly: The Building of BAM and Late Soviet Socialism. Pittsburgh, Pa: University of Pittsburgh Press, 2009.