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.

Hong Kong court finds tycoon Jimmy Lai guilty in landmark security trial
Ukraine peace talks stretch into second day at start of pivotal week for Europe
Flash floods kill at least 37 people in Morocco's Safi province
'Hero' who disarmed Bondi gunman recovering after surgery, family says
School bus accident in Colombia kills 17, injures 20