Judge rules decommissioned officer must remain in jail