The military's international spokesman, Lieutenant Colonel Nadav Shoshani, said: "The soldier documented in the video acted contrary to procedures by firing in an unprofessional manner and not complying with orders.
"As a result, the soldier was sentenced to 20 days in prison."
Replying to social media comments, he added: "Just to clarify: He was firing towards an open area and not at civilian homes in Gaza.
"Still unprofessional and not in accordance with our orders."
And, in a separate statement, the army told the Kan public broadcaster that the soldier's actions constituted "a grave incident that does not accord with the values of the IDF and with the standards expected of combat soldiers and their commanders".