Your doc was just doing what CDC has been recommending since 2006 with respect to HIV testing.
CDC estimates that now, with better treatments available, more people are living with HIV.
So by 2006 more than 20% of the HIV-positive people in the US did not know they were HIV-positive.
And, this 20% accounted for about half of all the new cases.
CDC cites studies to show that when a person does know they are HIV-positive, their risk behavior drops significantly.
Therefore, CDC is recommending that HIV testing be done as part of
routine health care.
Here is a link to a tutorial about all this CDC recommendation:
ETA: The business about "at least once in your lifetime" is within the CDC recommendation,
but CDC's recommendation is more along the lines of "routine health care",
and is more of an "opt-out" at each visit.