Being denied entry isn't illegal, and isn't necessarily going to adversely affect future entry attempts. Overstaying your visa, or illegally entering a country on the other hand is a crime. If you have committed crimes in a country, you will have a harder time getting in next time.
Overstaying your visa is not a crime. The Immigration and Nationality Act (INA) contains only civil penalties for an immigrant who overstays her visa. This means that immigrants with an expired visa will not be charged criminally or serve time in jail.
careful: there's a difference to point out here - Visas are for entering/exiting the country and are the stamps on the passport. Then you can stay as long as you have your residence permit.
Example:
#when you enter the country you get
DS2019: 1yr #residence permit
Visa: 1yr # from when you enter the country
until you leave the country:
if your contract get renewed (DS2019++)
else illegal
the visa in your passport is worth nothing when inside the US. the fact that the two are confused might be very misleading.