Why did he say he thought we were just friends?

So there is this guy, and we slept together a few months ago, and since then he acted like he likes me.. he would buy me coffees and would even spend up to 8 hours together just walking around town etc... All my friends thought that he likes me. Anyways, we never actually talked about sleeping together and what it meant, so even though i thought he liked me, I was never quite sure where we stand. Basically, today I messaged him saying 'are we just friends, a yes or no will suffice cba for any long ass DMC' and he said 'yeah i thought we were just friends'... So does that mean that the whole time he was just leading me on? And why would he do that because he literally gained nothing from it as we didn't do anything since?
Why did he say he thought we were just friends?
Post Opinion