Because there is a reason they have been given the same name. They belong to the same family of virii. There are studies showing that exposure to one CoV induces immunity to the other.
Here is just one paper around that topic: https://pubmed.ncbi.nlm.nih.gov/34273512/