Student or Learner
I would like to confirm which usage is correct. I think "spend time doing something" is correct. For example, "thank you for spending time reading my post".
However, I have seen people using "spend time to do something", for example, I googled about 1000 results of "spend time to visit".
To spend time doing something means you use the time available to you for something.
I spent a lot of time (at the station) seeing you. -- It means you were there and was seeing her in the meantime.
I spent a lot of time (at the station) to see you (=reason clause). -- The reason why I was there was to meet you when you arrived at the station.
Mind you, in not all circuimstances is it possible to use both the '-ing' and the 'to' version. They do not always make sense:
I spent time cleaning the house. -- makes sense: you were cleaning
I spent time to clean the house. -- does not make sense: the reason why you spent time was to clean the house.