The total sound you get from the string is a sum of the sounds from all of the overtones present. If the seventh overtone is present, and it is played along with other notes from the scale (particularly the 7th or diminished 7th of the scale), a dissonance from this out of tune note is heard.
The relative amount of each overtone one will get depends on how and where the string is plucked or struck. Try plucking at different locations on a guitar and you will hear different sounds. Each vibrational mode above the fundamental has locations called "nodes" where there is no motion of the string. If the string is plucked or struck at a node of a mode, then the corresponding overtone will not be present in the sound. Hence, plucking or striking the string 1/7th (or 2/7th,..) along the string will remove this dissonant overtone from the vibration. The hammers in a piano, for example, are generally located near a node of the 7th overtone for this very reason.
The problem with the 7th can be illustrated another way. Consider the table below which lists the harmonics of C3 along with the closest notes available for the just and equal tempered scales. The 7th harmonic is just not very close. For this table the fundamental of the two scales has been defined to be equal to 130.81 Hz [C3].
The 7th harmonic just doesn't quite fit into the scheme. The next harmonic which doesn't work well is the 11th. Note, however, that of most concern will be the first 8 harmonics. See the Rule of 8 for more information.
There are some times, for example in some barbershop quartets and other types of performance involving four part harmonies, when the 7th harmonic is used during the performance. That the use of the 7th harmonic might sound better than the notes we normally use can also by understood from the rule of 8.
Questions/Comments to: firstname.lastname@example.org .