Divine Allegiance only transfers damage, not other effects.
The Oath of the Crown paladin's Divine Allegiance feature description states (SCAG, p. 133; emphasis mine):
Starting at 7th level, when a creature within 5 feet of you takes damage, you can use your reaction to magically substitute your own health for that of the target creature, causing that creature not to take the damage. Instead, you take the damage. This damage to you can’t be reduced or prevented in any way.
The only thing mentioned being transferred to the Paladin is “the damage”, so no other effects of the triggering feature target the Paladin.
...unless the effect depends on "this damage".
Things get a little complicated when the triggering feature has an effect that depends on "this damage", such as the beholder's disintegration ray:
If this damage reduces the creature to 0 hit points, its body becomes a pile of fine gray dust.
Since this effect depends only on taking "this damage", and Divine Allegiance transfers "the damage", the effect does transfer. At least, from a somewhat strict rules-as-written reading. In contrast, the death ray seems to require that the target actually be hit by the ray:
The target dies if the ray reduces it to 0 hit points.
Check with your DM anyway.
I'll hedge this a bit by saying you should discuss the ruling with your DM. The Oath of Redemption paladin has a very similar feature, Aura of the Guardian, that explicitly does not transfer other effects (XGTE, p. 38; emphasis mine):
Starting at 7th level, you can shield others from harm at the cost of your own health. When a creature within 10 feet of you takes damage, you can use your reaction to magically take that damage, instead of that creature taking it. This feature doesn’t transfer any other effects that might accompany the damage, and this damage can’t be reduced in any way.
The omission of this clause from Divine Allegiance might motivate a ruling that the beholder's Death Ray effect does transfer over.