I'd say that it really doesn't help you write better music hardly at all.
I wanna disagree with this statement. While it probably doesn't help to know music math as much as, say, listening to a lot of music and analyzing it, it does help to understand where we get intervals, and their relationships with each other. For example, lower harmonics are generally more consonant, like the third harmonic, which is a 5th, and the 5th and 6th harmonics, which are major and minor thirds. Understanding these facts may help to explain why people see these intervals as consonant, or at least give a partial explanation. Maybe this isn't a direct benefit from understanding math, but it definitely helps.
I would also look into Fourier analyses, which are cool if you understand the math behind them (which, tbh, I still don't understand)