Hi Lillian.
This is a common expressión and "de qué" has an exclamatory and interrogative meaning, that's why "qué" has an accent. There are other similar expressions, "no hay por qué", "de qué".
Also when we are talking about a question or make an indirect question "qué" has an accent.
"No sé por qué lo hiciste", "no entiendo por qué te comportas así", "me gustaría saber por qué no lo aceptas".
Have a nice day.