Here is a highly condensed version, sufficient to show that part of your question is incorrect.
There were several different bands of Nez Perce Indians which had more or less separate governments.
Various groups of Nez Perce were more or less coerced into signing a treaty in 1869 giving up most of their land. Some Nez Perce groups didn't sign the treaty and were known as non treaty Nez Perce. Their lands were among the lands given up in the treaty. Chief Joseph used the analogy of paying Joseph's neighbor for Joseph's horse to explain how unjust the claim that the lands of his band had been legally sold was.
With rising tensions between settlers and Nez Perce, General O.O. Howard called a council with the non treaty Nez Perce leaders in 1877 and gave them a deadline to move off their lands and onto the reservation. As the non treaty bands gathered to comply a few angry warriors killed a few white men, and the fighting began.
The war mostly consisted of the no treaty Nez Perce fleeing, trying to find a safe refuge, and being attacked in several battles. In the end some were killed, some were captured and sent to the Indian territory instead of to the Nex Perce Reservation, and some escaped to Canada and eventually returned to the USA.
In 1889 the remaining non treaty Nez Perce were returned to the Pacific Northwest but settled in the Coville Indian Reservation in Washington instead of the Nez Perce reservation.
There were 3,499 Nez Perce listed in the 2010 census, many living in the Nez Perce reservation in Idaho.
Thus the original question is inaccurate. The US army (or part of it under the orders of General Howard) didn't force "The Nez Perce" to move in 1877, it forced some of the Nez Perce, the non treaty bands, to move in 1877. And the move to the remaining part of the Nez Perce reservation didn't happen as scheduled, since fighting broke out.
Clearly a few angry young Nez Perce warriors started the killing and fighting, not the US army, except indirectly by putting pressure on the non treaty bands to move.
Furthermore, the non treaty bands only tried to defend their lands for a short time, until being defeated at the Battle of the Clearwater, July 11-12, 1877. After that the Nez Perce fled seeking safety, pursued by General Howard and by other US troops.
The motive for the army to fight the Nez Perce after the fighting started was to protect US civilians by defeating and subduing the Nez Perce as quickly as possible to minimize the damage and killing that they caused to US civilians. As it happened, during the war the Nez Perce tended to fight in a very humane and civilized way, far more so than most Indians and a lot of white men did, and far more than the soldiers expected them to.
Thus it can be seen that the wording of your question is at least partially incorrect.