To be fair to Trump, he never actually said he had recorded his conversations with Comey, only that Comey "had  better hope no recordings exist". While that isn't the same as explicitly claiming to have recorded them, it seems crafted to hint that could have happened. Either it was Trump's usual verbal sloppiness (only to be retracted later) or it was a deliberate attempt to scare Comey. Either way the news media lapped it up.