The referendum did not include the states that already left (like the Baltic states and Armenia). Russia was the largest state but they actually were one of the lowest who voted to keep (above 70% I believe). The central Asian states voted the highest to keep the union (over 90%). Belarus and Azerbaijan were also very high.
The dissolution was not only illegal but clearly against the will of the people.