The Pentagon is investigating a major error by the Air Force that allowed gunman in the Texas church massacre to buy the assault rifle he used.