I think its more than "we just found some math that fits the data" in the sense that its not just a case of adding some terms to match an observed curve - for example like with Rayleigh-Jeans' law vs Wein's Approximation of blackbody radiation and eventually Max Planck's solution by quantizing energy to the curve match experiment, without actually having anything else to say about it.

Spiritually it feels more like what happened later, when people took the idea of quantized energy seriously and began finding ways to make it a theoretically consistent theory which also required a radical new approach of disregarding old intuitive assumptions about the way the most fundamental things worked solely to obey a new abstract, esoteric, purely theoretical framework (an approach which was sometimes controversial especially with experimentalists).

But of course this new theory of quantum mechanics turned out to be immensely successful in totally unprecedented ways, in a manner similar to Relativity and it's "theory first" origin with trying to ensure mathematical consistency of Maxwell's equations and disregarding anything else in the way (and eventually with Einstein's decade long quest to find a totally covariant general theory that folded gravity into the mix).

With physics the more I dug into "why" it was rarely the case that it was "just because", the justification was nearly always some abstract piece of math that I wasn't equipped to understand at the time but was richly rewarded later on when I spent the time studying in order to finally appreciate it.

The first time I solved Schrodinger Equation for a hydrogen atom, I couldn't see why anyone could've bothered to try discovering how to untangle such a mess of a differential equation with a thousand stubborn terms and strange substitutions (ylm??) and spherical coordinate transformations - all for a solution I had zero intuition or interest in. After I had a better grasp of the duality between those square integrable complex functions and abstract vector spaces I found classical QM elegant in an way I wasn't able to see before. When basic Lie theory and representations was drilled into my head and I had answered a hundred questions about different matrix representations of the SU(n) and S0(3) groups and their algebras and how they were related, it finally clicked how naturally those ylm angular momentum things I saw before actually arose. It was spooky how group theory had manifested in something as ubiquitous and tangible as the structure of the periodic table. After drudging through the derivation of QFT for the first time, when I finally understood what was meant by "all particles and fields that exist are nothing more than representations of the Poincare-Spacetime Algebra", I felt like Neo when everything turned into strings of code. And there's no point describing what it was like when Einstein's field equations clicked, before then I never really got what people meant by the beauty of mathematics or physics.

I guess its not really the answer "why" things are, but the way our current theories basically constrain nearly everything we see (at least from the bottom up) from a handful of axioms and cherry-picked coupling constants, the rest warped into shape and set in stone only by the self-consistency of mathematics, I feel like that's more of a "why" than I would've ever assumed answerable, and maybe more of one than I deserve.