Hopefully?
But he should at very least know better if he's the secdef. If anything, the civilian leadership should be more restrained than the military.
And it does signal that no one is briefing him beforehand on things you really should or shouldn't say.