Why should Hashem be angry at Bnei Yisrael if Aharon or his sons disobey and mourn? Why is the community held liable for their wrongdoing?
Among the many answers to this question (see Ibn Ezra, Da'as Zekeinim, Ohr haChaim, HaKsav V'haKabbalah) I want to focus on that of the Alshich. Loss and tragedy often give rise to doubts and questions of faith. It takes a remarkable person like the Sanz Klausenberger Rebbe to not only rebuild, but inspire others to not lose faith and to rebuild after losing everything. It takes a remarkable person like Mrs Racheli Frankel to go around speaking about emunah when her son was murdered by terrorists.
At times of loss and tragedy, we need Rebbes like the Sanz Klausenberger; we need mothers like Racheli Frankel. We need people who can lead Klal Yisrael out of despair and teach them to mourn, to reflect, to grow, and not to lose faith. Hashem was telling Aharon to be careful lest he or his sons trip up and incur punishment because they are the ones who can do that. G-d would certainly not hold Klal Yisrael accountable for Aharon or his son's missteps. But if Aharon or his sons were to be punished for their missteps and lost, their absence would create an unfillable void that would inevitably lead to the nation sinking into doubt and despair and incurring Hashem's anger.
Perhaps the reason Hashem expressed concern for the effect the loss of Aharon or his remaining sons might have on Klal Yisrael was not just for the sake of the tzibur, but rather it was for Aharon's sake as well. Aharon was charged with doing avodah and bringing kaparah to the nation. Imagine his thoughts at that moment -- here his avodah could not serve to protect his own children; how could he serve as a meilitz for the nation as a whole?! The pasuk therefore comes and reminds Aharon that despite the death of Nadav and Avihu, his presence, his influence, his avodah, was both necessary and critical for the nation, even to the point that he was not excused for doing avodah even to mourn.
Viktor Frankl, himseld a Holocaust survivor, built his whole theory of psychology around the idea that a person who has a purpose to live for will lead a successful and happy life. Hashem here was giving Aharon a renewed sense of purpose by reminding him that his presence and influence was essential to Klal Yisrael.