Israel had to pass this law. You cannot have a free country in which unelected tyrant judges overrule the elected government.
It was becoming a judicial dictatorship.
Elections have consequences and Netanyahu’s majority in Parliament (64 out of 120) is governing.