Via a bit of executive branch magic, he effectively pulled out the worst bits of the NDAA. Read the entire article. It’s mandatory.
The thing to really point out is that had he vetoed the original bill (remember, there’s no line-item veto any more), then it almost assuredly would have gone back to Congress and passed again. In effect, the veto would have been purely symbolic and accomplished nothing. Instead, Obama once again played the long game and we ended up all the better for it.
The perfect president? Of course not, but I really do need to stop assuming the worst whenever he takes what appear to be terrible positions on things.