There are a few reasons why.
When you look at a periodic table, the atomic mass of any given element is the average of the isotopes of that given element. The natural isotopes and their relative abundances are taken into account when determining the atomic mass. Hydrogen can also exist with one (deuterium) or two (tritium) neutrons. The relative abundance of hydrogen, deuterium, and tritium are roughly 99.988%, 0.012%, and trace (respectively). This is why hydrogen is slightly greater than 1 (about 1.008).
Second is that the weights of protons and neutrons are slightly different. Neutrons can decay into a proton, electron, and electron antineutrino. This means that neutrons have more mass than protons.
The third is that the mass of an atom includes energy holding the everything together. What if we were to isolate every proton, neutron, and electron of an atom? If you add everything together, you will see that the mass of the sum of the individual particles is more than that of the atom as a whole. This is due to the binding energy of protons and neutrons binding together. Electron kinetic and binding energies contribute to the mass of an atom as well.