one would expect the doctor to retire

The meanings are as follows but the words in bold need not be said/written, as they are implied in the tense of the verb

  1. After spending so many years working in hospitals, one would expect the doctor to have already retired.

  2. After spending so many years working in hospitals, one would expect the doctor to retire at sometime between now and the near future."

Q2) What is the subject of "spending".

Spending does not have a clear subject because you have not given sufficient context.