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.

Pakistan steps up diplomatic bid to get US-Iran peace talks on track
Philippines vows to arrest fugitive senator wanted by ICC
UN condemns Israeli decision to establish military facilities in East Jerusalem
Canada PM Carney says Israel's treatment of Gaza flotilla members is 'abominable'
Tankers exit Hormuz as Trump, Vance talk up Iran deal prospects