He would have had obligated service from his time at the Naval Academy and obligated service from his flight training. Currently, the USNA obligation is 5 years and the flight training obligation is 6 or 8 years depending on the type of training. The lengths of obligated service may have been different back in his day. Moreover, he would have been a commissioned officer already during his flight training which would have counted against his USNA obligation.
10 U.S. Code § 653.Minimum service requirement for certain flight crew positions
10 U.S. Code § 8459.Midshipmen: agreement for length of service