Speaking to Doctor Who Magazine, the Who producer admitted that Smith auditioned for the role of Dr Watson before landing the role of the Doctor.
Recalling the first time he met Smith, Moffat said: "He was auditioning - bizarrely enough, if you can picture this - for the role of Dr Watson in Sherlock.
"We'd already cast Benedict Cumberbatch [as Sherlock Holmes] and the very first person we saw for Dr Watson was Matt, who came in and gave a very good audition.
"But he didn't have a chance in hell of getting it 'cos he was clearly more of a Sherlock Holmes than a Dr Watson. There was also something a bit barmy about him - and you don't actually want that for Dr Watson, you want someone a bit straighter."
Moffat added that he felt that Smith was "clamping down on his barminess" for the audition.
He added: "Oddly enough, I wrote an email where I said, 'I saw this guy today for Dr Watson and I'd noticed he was on the list for Doctor Who' - so the Doctor did flip through my head at that time."
> First Smith 'Doctor Who' titles confirmed