This isn't good advice only for people who have possibly committed a crime but also (and especially) for those who are confident that they have not. The police are asking you questions to "get to the bottom of it" and they encounter people every day who do think they can lie to get out of a crime; they think you might try to lie to get out of a crime. They won't trust your words but they will verify your words. If your words turn out to be false, then they'll tell the judge/jury that you lied to them, not that you were mistaken; in the absence of stronger evidence (against someone else) they might claim you were possibly even intending to direct their investigation toward a red herring with your falsehoods.
The only revision to this advice I've heard in the past decade-and-a-bit: tell the police your real first and last name if they ask. It's not always a requirement but some states have "stop and ID" laws, which means you have to identify yourself to law enforcement during a "lawful detention" (other states instead require it after an arrest).