Senior military, like senior civil servants, aren’t allowed personal views - at least not until they retire or are fired. For reasons explained by Sir Humphrey Appleby.
He may have been right in what he said, but he was wrong to say it - which he himself accepts, as well as the inevitable disciplinary action which would be taken.