To avoid lawsuits? I was told that if they had to perform surgery or administer medication, they wanted to be absolutely certain you were the right patient. Hence the repeated questioning.
There are cases of doctors doing surgery on the wrong patient.
Or take off the wrong leg on the right patient!
That’s happened!