Why did Nelson Mandela go to jail?

He was one of the leaders of Umkhonto we Sizwe, which was the military wing of the ANC and responsible for acts of violence and terrorism.
Nelson Rolihlahla Mandela was sent to prison because he advocated majority rule in South Africa, at a time when apartheid, the separation of black Africans and whites, was the policy of the ruling white minority there..

Nelson Mandela was sentenced after being found guilty in the Rivonia Trial. The charges in this case were:
  • recruiting persons for training in the preparation and use of explosives and in guerrilla warfare for the purpose of violent revolution and committing acts of sabotage
  • conspiring to commit the aforementioned acts and to aid foreign military units when they invaded the Republic,
  • acting in these ways to further the objects of communism,
  • soliciting and receiving money for these purposes from sympathizers in Algeria, Ethiopia, Liberia, Nigeria, Tunisia, and elsewhere.

The trial was condemned by the United Nations Security Council and nations around the world, leading to international sanctions against the South African government in some cases.