we know that there is 99% empty space in atom, so there will be 99% also empty space in wall but why sunlight not pass through wall
In fact, you answered your own question? Yes, indeed nearly everything is empty space including space between the electrons of an atom to its nucleus. 99.9999999% of Your Body Is Empty Space . Some days, you might feel like a pretty substantial person.
Questions and Answers (https://education.jlab.org/qa/atomicstructure_10.html)
If atoms are 99.999999999999% empty space then why don't things pass right through them?
Things don't fall through other things because they are levitating on an electrostatic field! I am not kidding! When you sit on a chair, you are not really touching it. You see, every atom is surrounded by a shell of electrons (https://education.jlab.org/glossary/electron.html) . This electron cloud presents a rather negative face to the world. Remember that like charges repel each other. When two atoms approach each other, their electron shells push back at each other, despite the fact that each atom's net charge is 0. This is a very useful feature of nature. It makes our lives a lot easier.
Now the question you should be asking is if atoms push away from each other, why doesn't the entire universe just blow away from itself? The answer is that some, actually most atoms' electron shells are not full. When two atoms come together and have empty spaces in their electron shells, they will share electrons to fill in the spaces in both of their shells. Yes, the electrons really do go back and forth between atoms and they do so pretty fast.
Electrons tend to be kind of mobile, which is also a very nice feature of nature since without it your mps player would not work. Once both atoms' outer shells are full due to this electron sharing, they go back to their usual repulsive behaviour. This, by the way, is how we get molecules and the secret to understanding Chemistry. It's all about the electrons!