Confucianism preaches that people are inherently good, and focuses on morals, which attracts many people. Confucius' teachers are wise and applicable to everyone; it's not a religion, but an ideology.
It became important during the Han dynasty in China when it began to become of the more dominant ideologies. During the Qin period, legalism was used to rule, and during the Han, Emperor Wu started using Confucianism to rule, while combining the ideas with legalism.
Also, Confucianism spread to places besides China such as Korea, showing China's sphere of influence and China's ability to spread cultural aspects without conquering the country (cultural diffusion).