When asked about where I wanted to be in my career by my boss (boss' boss actually), I was honest about having my resume out there and looking for other opportunities outside my current company. Now, I've heard from other sources a promotion that was possible in my future has been basically pulled.
Honesty is not a good policy. Keep lying.
Everyone says they want the truth, but if you are told you're not doing meaningful work, the justification for your job is vanity metrics, and the guy with less experience than you who does terrible work makes more money than you, how happy would you be?
If you told management, you're using the position and any promotion as a jumping off area for a newer better job at a different company, how happy would management be?
I think that's a bad idea for reasons different than the ones you seem to have intuited. If you are asked where you want to be in your career by your employer, they are asking what you want to be doing (with a subtext that they are trying to find out whether and how they can be the employer for which you are doing it.)
If the focus of your answer to that question is that you are shopping around for opportunities outside of the company, you are basically answering that what you want is, above all else, to be somewhere else.
I don't think the lesson that should be learned from this is "keep lying", I think the lesson is "be honest, but -- in business dealings -- focus on the parts of the truth that the person you are dealing with can, at least potentially, act on in a mutually beneficial way". In this case -- if you are asked where you want to be in your career, you tell your boss what you'd like to be doing.