Galileo was imprisoned for violatiing his sentence on him by the Roman Catholic Church in 1616.
He was prohibited from supporting Copernicus.
Copernicus, as you know, showed that Aristotle is wrong.
The Church preferred to believe what is wrong and prohibited Galileo from publishing what is correct.
In 1616, he could not prove mathematically his Copernican assertions (but, Aristotle did not either, though because of it being geo-centric, the Church accepted it).
Later, Galileo was invited to explain himself again. Armed with Kepler’s math, and a new Pope, he agreed.
He failed to present the math properly and was charged for his continued support of Copernicus.
He was sentenced to prison, for life, by the Church.