Maciel, an infantryman assigned to Fort Benning, Georgia, had been in the Army for two years and in Afghanistan since February, the 3rd Infantry Division said in a statement.
The secretary of state asserted that the Taliban understands USA resolve and is "beginning to see that they can not wait us out". The militant group acknowledged the attack but did not claim responsibility.
Details of the incident, which is still under investigation, were not released.
This is the third combat fatality in Afghanistan this year. Some of the USA forces are involved in counterterrorism operations, particularly against the Islamic State jihadist group.
The NATO-led coalition in Afghanistan, Resolute Support, said Saturday that the incident was under investigation and that the two wounded United States service members are being treated and are in stable condition.
The term "insider attack" refers to attacks carried out against USA military personnel by the Afghan troops they are training or advising. Though a recent ceasefire gave people hope that an end is in sight, it lasted for only three days, according to The Washington Post.
Pompeo also added, perhaps optimistically given Afghanistan's long history of resisting foreign forces, that the Taliban were "beginning to see that they can not wait us out".
Insider attacks are commonly referred to as "green on blue" attacks. In that incident, a Romanian soldier was injured.