According to the prosecutor’s office, it's because they're accused of having links to the network of US-based cleric Fethullah Gulen.
Ankara says it was him who orchestrated a 2016 attempted coup.
Those who are facing jailtime include three colonels, eight majors and 10 lieutenants.

Climate crisis is 'outrunning us', UN chief warns COP31
US House blocks bid to impeach Defence Secretary Hegseth
Threats sent to UK and Irish schools dismissed as hoax
Former Pakistan PM Imran Khan back in jail after medical treatment, sources say
