I would say because a mixture of poor leadership and lack of resources (weapons primarly).
In the year 1900, an unprecedented alliance occurred between the eight major military powers of the world: Austria-Hungary, France, Germany, Great Britain, Italy, Japan, Russia and the US.
Against this common enemy, a secret society came to be, whose goal was to exterminate all the “foreign devils” within China. Never before, and never since, had there been such a popular alliance fighting against invaders. This society and its fighters came to be known as The Boxers (probably due to the fact that the westerners often saw them doing physical exercises and Tai-Chi, considered close to boxing).
In reality the Boxers were mainly peasants of the poorest regions of china that thought (or were led to believe) that the cause of their poverty were the westerners (actually even without westerners probably they would have been in the same conditions anyway under the domination of local warlords).
The Boxers had few and very old traditional Chinese weapons or were armed with agricultural tools (forks, spades, clubs…). They also lacked military training and discipline so that their attacks resembled more hooligans’ brawls than military planned operations. To alleviate the lack of armament they were even induced to practice magic rituals that would protected them from bullets…!
The leadership of the Boxers was also a little bit confused. Apparently they were led by Prince Tuan guiding the Boxers towards the just emancipation from the occupation of the westerners. In reality, I think, they were puppets in the hands of the Qing Empress Dowager Tzu’u Hzi. She was acting in a very devious way: if the Boxers had won she could say that from the start she had supported them to the point of involving the regular Imperial Army to help them; but if the rebellion had failed, then she could (and did) present herself as an innocent bystander involved against her will in the fighting only to defend Chinese territory from the landings of foreign troops (attempting to relieve the besieged western legation in Beijing).
Soon the Boxers became too focussed upon eliminating the foreign ambassadors in the legation quarters of Beijing (using mainly suicidal frontal attacks) to pay attention to the fact that strong military contingents of the western nations were landing nearby and converging on the capital to crush them. They left the job to stop these relief parties to the regular Imperial Army (lead by General Jung Lu) whose generals were not exactly thrilled to work for the Boxers!
As more and more western troops started to land and move to relieve the legations in Beijing the situation of the Boxers became more and more dramatic. Their fruitless frontal attacks against the combined armies in Beijing (small but well organized and highly trained) were rapidly bleeding them white. The regular army was not really helping them. As the foreign relief armies fought they way to the capital the Boxers’ forces started to melt away into the countryside.
At the end of the day the Boxer Rebellion did exactly the opposite of what was intended to do: It united its enemies in a strong and formidable coalition (the western powers) and divided the Chinese forces (the boxers’ leaders against the Imperial Army generals against the Empress and all against each others) producing a fragmented and higly vulnerable force.
[References:L. E. Bodin, C. Warner The Boxer Rebellion. Osprey Men-at-Arms Series, 1979]