I think I'll let that question hang in the air.
Because you can't answer it.
A church is defined by its beliefs. If someone claiming to be a member of a church publicly repudiates or distorts a teaching of his church, his church has a right to punish or excommunicate him.
Galileo's punishment may have been unjust and imprudent, but Church tribunals are not unjust per se.