In an earlier scene in Stargate where Jackson and Colonel O'Neil had been captured by the henchmen of Ra, and after some butt kicking, O'Neil couldn't shoot Ra with the stolen weapon due to the presence of children surrounding his/her throne. How about the end final scene where they teleport the a-bomb up to the pyramid, were children still in the pyramid? If so why not just shoot the kids in the first scene?
Because they had no choice in the end.
Recall that the original bomb was merely intended to destroy the stargate so that it could not be used to threaten Earth.
However, the bomb had been altered by Ra to be 100 times more destructive than the original. Essentially it was a planet wrecker.
Consequently, unable to stop the countdown or disable the device O'Neil and Jackson used the only option available. Send it back into Ra's ship in space to save both Earth and the desert planet (that would eventually be called Abydos)...and perhaps, not coincidentally, blow Ra to hell.
Assuming the children were still on the pyramid, which seems likely, they were also killed.