In this context, when we talk about “states” we are talking about countries, not about states like those that make up the US.
This is a difficult issue and there are arguments to be made on both sides. On the one hand, this proposition seems eminently logical. It does not make sense to allow tyrants from lawless countries to abuse their people with immunity. If we think about Nazi Germany, this makes sense. Nothing that Hitler did in the Holocaust was actually against the law since the Nazis got to make all the laws. However, the Nazis’ actions were clearly wrong and they were quite justly brought to trial for those actions. It would make sense to make all countries subjected to the ICC and ICJ so that no one could get away with violations of human rights.
However, it is not easy to require all states to give up their sovereignty in this way. For example, imagine if a majority of countries voted to try President George W. Bush for war crimes in connection to the invasion of Iraq. This would surely be unacceptable to the US because it would be a politically motivated attack against Bush’s policies, not a serious charge. If we make all states be subject to these bodies, we would potentially run into cases like this.