Then was the bible God taking a moral action for killing children by the sword?
God is the manifestation of morality. Morality is only moral because God said so. Who gave the children life in the first place? What did Job say? Naked I came, naked I shall return. The Lord gives and He takes away. Now, I don't know about you, but I am in no position to sit here and place God under my microscope. God has every right to do what He will with His creation. He was taking a moral action against the inherent sin that is inborn in all of mankind, yes. He was taking a moral action against the indignant Pharaoh for his disobedience, after warning him of the consequences, yes. While it is convenient for you point of view to take things out of context, it is hardly the logical position you claim to take. So I would say that in God's case, yes. He gave them life and was continuing to provide it to the. He warned the Pharaoh of the consequences of his actions and when Pharaoh still didn't listen, God was faithful to His word.