Of course, we don't really know why any laws of physics are the way they are- that's still a mystery- but if you want to know why we arrived at something like the Schrodinger equation, read on...
At the time quantum theory came about, we knew that atoms were made of electrons and protons with equal but opposite charges. That was a problem straight away, because the oppositely charged particles should attract each other, and yet atoms were a lot bigger in size than protons and electrons, so there had to be something that was keeping the protons and electrons apart within the much bigger volume of the atom.
We also knew that atoms of different elements would only absorb or emit certain frequencies of light, so the idea was developed that the electrons were in orbit around the protons, like planets around the Sun, and they could jump between the different orbits by absorbing or emitting a photon of light with just the right energy.
The problem with that idea was that experiments had shown that accelerating electrical charges gave off electromagnetic fields, so if electrons were in orbit (which is accelerated motion), they should just radiate away all their energy and spiral into the middle of the atom. So we needed an idea for why that didn't happen, and why only specific electron orbits were allowed.
Separately, Louis De Broglie had come up with the idea that all particles were really waves, which was the complement of the idea that waves of light were really particles (photons). That gave an intuitive reason for the electron orbits. If an electron had a wavelength, its orbit could only have a length that was an integer multiple of the wavelength, since an orbit of any other length would interfere with itself.
So that gave all the essential ingredients for a model in which electrons were waves, with set of stable orbits around the positively charged nucleus, and the ability to jump to a higher orbit if they absorbed a photon of the right colour (energy).