Thought Amc had bought a part of BBC, and that Hbo max had bought the exclusive rights to prior seasons?
BBC America airs the show in the United States. In other countries, Doctor Who airs on different channels. No matter who airs the show, they have to pay for the rights to do so. Even though BBC America is co-owned by the BBC, they probably still have to pay a licensing fee, although it might be less than what Sci-Fi would have paid back in the day thanks to corporate synergy.
HBO Max's exclusive rights are probably not worldwide rights. Currently, I think HBO Max is only available in the United States anyway. Plus, I think it is only the streaming rights, so in theory, the BBC could have two different providers (broadcast and streaming) paying for the rights to Doctor Who in every country that wants it. Usually the way these contracts work is that they pay a set amount per episode, so I still think it's probably worth is for the BBC to make the show no matter what the ratings are in the UK.