You are confusing law and alignment there. Those are different things.
Good and evil are real and measurable forces and have their own planes of existence and everything. There are spells that hurt creatures of specific alignments by literally flooding them with good (or evil).
"Good" implies "respect for life". Not just innocent life, but life in general.
When they say that good characters "protect innocent life", in gameplay-terms that means you can play a good character in DnD. Your character is not terminally crippled and locked out of the game.
In-universe, it means that not all good characters are fanatics who would rather let the agents of evil run free than raise their hands to kill them. If protecting the innocent means to oppose evil, then good will oppose evil.
That can in fact present a challenge for good creatures (like devas). If they keep killing evil creatures, how can they maintain the good respect for the many lives that they are snuffing out? In a universe where good and evil are genuine forces, and not merely philosophies, killing many creatures puts them at risk of becoming (painfully) realigned, like a compass.
Of course, turning evil from just killing evil monsters is not something that player-characters should have to worry about (though they can make plans for such an event with the DM).