But it's equally illegal to kill anybody based on race, class, political belief or religious belief.
As for those other things (whether it's equally legally bad to kill someone regardless of "class, political belief or religious belief") all of those have been contested in actual law across societies (including western ones), even 20 and 30 years ago (and tides can always turn one way or another again).