Duran was very popular around the world as lightweight champ. Sugar Ray was a "golden boy" and hyped star(though he lived up to the hype). It wasn't unexpected. Some of the crowd probably did support Leonard due to his Gold medal in Canada and tv appearances but much of the crowd supported the warrior and probable underdog in Duran.

Leonard was the favorite out of Vegas at 9-5 because Duran was coming from the lightweigh division and was figured to be much smaller. When they got in the ring Duran was just shorter not smaller, his legs were trim and muscular and his broad shoulders had extra muscle on them compared to holding 135lbs.
I had a great night, our live show fighters all won and I cleaned up against the guys from Hartford who had Leonard. Good times!!! Ray

I do not think racism played into at all. People do cheer for the underdogs and roberto wore a shirt with bonjour montreal on it whenever he was training or out in public. His corner also unveiled a Quebec flag in the ring.

Leonard was a pretty boy, Duran was a gritty "blue collar" fighter; although Leonard was undefeated, it was with fewer fights under his belt, while Duran, more popular worldwide, had only one defeat in far more fights and an impressive KO record.

Not only against Leonard, Duran's popularity should not be understimated. In almost every venue and against major opponents(Moore, Barkley, Hagler, et al), Duran was the crowd favorite. To this day, he remains one of the more popular figures the sport has ever seen.