Is it OK to use 12-3 awg to wire a ceiling fan and light?
There's no problem at all with what you've done. In fact, that's the way it's supposed to be done.  If you were to use two /2 cables, you'd either be paralleling the neutral (310.4), and/or not running all the circuit conductors together (300.3(B)). Parallel neutrals are not allowed in this situation, so you've actually avoided a code violation by doing it with /3 cable. You've also kept all the circuit conductors in a single cable, and avoided violating that code section.