The president said the graduating cadets would enter a service no longer subject to “absurd ideological experiments” or “nation-building crusades.”