Three reasons.
As I understand your question you think like that: nucleus consist of protons and neutrons, they have same mass, so the nucleus mass should be integer multiply of this base value.
First, mass of proton is different from mass of neutron by about 0.5‰, so even if there are integer numbers of them in nucleus its mass can't be expressed as integer number (hopefully you will understand what I mean). Neutron mass is almost proton+electron mass, so - as there is same number of electrons on the orbitals, as protons in nucleus, atom mass should be multiply of the neutron mass - but it is almost, not exactly.
Second, when the protons and neutrons combine into nucleus some energy is released (someone more fluent in English may follow witch correct nomenclature - is it bonding energy?). This energy is equivalent to some mass deficit, thus even if there will be no first reason, nucleus mass will be not integer.
Third, naturally occuring elements are mixtures of isotopes, and atomic wieght given is a weighted average of their masses.