Because as know as in earlier in the play there is a comment "Would a rose by another name still smell just as sweet" meaning that if they looked different or had anything different as appearances they would still be the same lovely person on the inside so he is just saying that she is just as beautiful in death as in life because she is still the nice person she was when she was alive. So now she is no different then when she was alive.
Romeo still figures that Juliet is still so beautiful because she may be a Capult and he (romeo) a Montouge, but there names don't matter to them because there love matters more than there families rivalry