Problem with your suggestion is that it would lead to players sometimes being stuck. For example if they fall down a deep spike pit, while being invincible and then not dying, because they didn't fall onto the spikes.
The invincibilty is needed though, because of situations like the one in the picture below. If invincibility wouldn't count on spikes, you might get knocked back into some spikes and then die instantly, which feels really awful.
Understood and agree! Thanks for the clarification.