As others have said, edgelords are popular in any culture because deep inside, we are all emo. Still, if you want Japanese culture-specific reasons, I can think of a few:
- Expression of Japanese postwar sentiments: Rehabilitation and reconciliation are two things Japan has sought since the end of World War 2, and central to that pursuit is trauma. These edgelord characters tend to have tragic backstories (sometimes too tragic) that inform not only their personalities but also their very agency. Who can the edgelord be outside of being a descendant of his clan or member of his community, even if that community is literally extinct because the entire village was burned and everyone slaughtered? Who can he be when his identity was forcefully taken away from him?
- Dark mirror of the dumb/aimless/everyman protagonist: For all their ideological clashes, the protag and the edgelord are not so different, you and I. A crucial thing they usually share is one of these two: both of them may not be properly integrated into society or both of them have not realized their potentials. That's why the edgelord is usually just the antihero and not the main antagonist. Thematically, he can even be looked at as a second protagonist. Since you're really into Persona 5 right now, look no further than Joker-Akechi as an example of this.
- The lonely audience can vicariously live through them: Related to the previous point, the edgelord, being an angst-filled rebel, can act as a vehicle for the Japanese everyman. He can be cathartical for someone who suppresses his ego for the sake of embodying salaryman cultural ideals of loyalty, commitment, and sacrifice. And even if you're not a salaryman, there's that modern Japanese ennui and isolation that can be gleaned from Akutagawa to Murakami to Takako Takahashi. The edgelord embodies this modern phenomenon, leading the audience to sympathize with or even relate to him.
- Dark mirror of Cool Japan: One of the ways Japan has pursued to reinvent itself is through kawaii culture. That's why waifus and moe and Rei Ayanami are everlasting. That's why isekai protags and hero's journeys and darlings in the Franxx/EVA/Gundam/whatever are eternal. Japan is cute, Japan is cool. Japan wears the freshest clothes, eats at the chillest restaurants, and hangs out with the hottest senpais.
But Japan exists outside of anime, which means it exists within time. And because it exists within time, it changes. What does it mean for anime to still sell you waifus while Japanese female novelists explore the ? Who can the Japanese woman be outside of being a mother and wife, especially when modernity has supposedly opened ? This kind of dissonance is found in the edgelord thanks once again to his Most Tragic Backstory Ever.