The law might say that, but it doesn’t make it right. Just like the abortion laws say that it is perfectly OK to slaughter an unborn baby...
What IS right? The law presumably exists for a reason, namely that the citizens of the state saw fit to equate murder in the commission of a felony to Capital Murder. The Supreme Court didn't create the law out of vapor like it did in the case of abortion "rights".