The Lord appointed the priests to reflect his holiness. If they don’t do so, he can show his holiness through them in a very different way. The two sons of Aaron have sinned flagrantly against his holiness, taking it lightly, neglecting it. In such a case he showed his holiness by expressing it in their sudden death. If God be not sanctified and glorified by us, he will be sanctified and glorified upon us
(Matthew Henry). That’s what he has done here and now.
3 Then Moses said to Aaron, “This is what the LORD has said: ‘Among those who are near me I will be sanctified, and before all the people I will be glorified.’” And Aaron held his peace.