It is often unclear what the root causes and real motivations are for interventions. If we think of genocide as an extreme example which might justify an intervention I can only think of one example where it can be claimed the war was fought to end a genocide; The Vietnam-Cambodian War 1978-79 which led to the occupation of Cambodia by Vietnam for 10 years.

In 1988 the New York Times carried a letter that stated; "it was the Vietnamese - and they alone - who drove Pol Pot's regime out of Cambodia and put an end to genocide" this was also critical of the US stance which remained implacably hostile towards Vietnam https://www.nytimes.com/1988/11/08/opinion/l-vietnam-rescued-cambodians-from-genocide-046588.html 

Even this case is not as clear cut as first appears; See https://en.wikipedia.org/wiki/Cambodian–Vietnamese_War#Background During the Vietnam War, Vietnamese and Cambodian communists had formed an alliance to fight U.S.-backed regimes in their respective countries. However in the long view there was history of conflict between Cambodia and Vietnam going back to pre-colonial times, in the period after the US withdrawal there was constituent fighting on the border between Vietnam and Cambodia. The government of Vietnam looked to the USSR for support, that of Cambodia to China. It becomes a moot point whether the Vietnamese acted out of frustration caused by constant border infringements or to "resume" Cambodia from Pol Pot. China invaded Vietnam in 1979 in response to its invasion of Cambodia.

Finally, as often happens the occupation forces were resented. See https://www.bbc.co.uk/news/world-asia-29106034 after the initial success and occupation by Vietnam there was was a constant insurgency against the Vietnamese occupation forces and it was this as much as the economic blockade led by the US that was responsible for the Vietnamese withdrawal in 1988.

Part 3 Consider - On Power - The difficulties of ends and means