>>720301898
In America the patent office is overwhelmed and basically just awards patents to anyone who files for one.
If a patent is invalid they leave it up to the courts to resolve it when it becomes relevant.
It's like passing legislation that violates the constitution. It can be on the books for a while before the courts declare it unconstitutional.