Never mix work and sex.
He's right. Affective relationships between co-workers are discouraged for several reasons, not just efficiency.
The problem is...your coworker is straight (or in the closet, maybe)...this might add some tension if he's paranoid you might rat him out on what you both did.
Unfortunately...is gonna be uncomfortable+weird unless you talk it out or decide to bury it altogether. Try to interact normally with him for both his and your sake and for your work. I'd say wait for him to come up with the topic of you two having hooked up and work it out.