This question already has an answer here:
- The major scale - why and how? 6 answers
Why are there seven principal tones (A-G)? Just tradition? In the same vein, why are various sounds (of differing pitches) said to represent the same principal tone?
Why are there seven principal notes?
The short answer is: We don't know. Some music traditions (Western, Middle Eastern, Indian...) prefer heptatonic (seven-note) scales. We are not sure if these traditions are connected or not. There are attempts to explain the major scale based on harmonics but they can't explain other heptatonic scales used by these traditions.
But heptatonic scales are in no way universal. Other musical traditions (African, Chinese, Japanese...) prefer pentatonic (five-note) scales. We also don't know why pentatonic scales are so widespread.
The second part of your question is not very clear.
If you're asking "Why C# ≠ Db?" take a look here. It's basically about the context.
If you're asking about why 220 Hz and 440 Hz (notes one octave apart) have the same name (octave equivalence), it appears to be related to the neurology of hearing.
If you're asking about why 440 Hz and 420 Hz are both called A in different tuning standards, it's mostly about tradition and standardization.
There are a couple of ways to look at it. Usually people look at the theoretical aspects, and talk about how its constructed from the overtone series. There is some truth to this. Once polyphony was invented (multiple voices sounding different parts at once) it was important that the notes we had were tuned largely to consonant intervals, which have a basis in the physics of acoustics, and the overtone series.
However, there is also the historical aspect to your question (which you allude to by asking if it is tradition). Historically, early western music was patterned after ancient Greek music. The ancient Greeks knew about ratios of string lengths, and as such, were well-familiar with the consonant intervals known as the octave, perfect fifth, and perfect fourth. They built scales using a system of two adjoining "tetrachords". A tetrachord is a four-note descending scale fragment in which the outer two notes are fixed an interval of a fourth apart, and the inner two notes could be tuned in various relations to one another (called the tetrachord's "genus"). Tetrchord-based systems were used to tune the strings of their lyres.
There were three genera of tetrachords (diatonic, chromatic, and enharmonic). The enharmonic genus used what we would call microtonal intervals, and the choromatic genus used two adjacent semitones; both of them then had a large gap in order to reach the fourth note. However, it was the diatonic genus (consisting of two steps and a half step) that would later be adopted into Western music. This was considered the most natural genus, as it filled the fourth relatively evenly, without as much contrast between tiny intervals and large intervals.
When two tetrachords were combined, it fell just short of an octave, by one step. This step could either be added to the bottom of the scale, or placed in between the two tetrachords (so the second one began a step lower than where the previous one ended).
Ultimately, the Greek developed a two-octave scale system consisting of four tetrachords called the Greater Perfect System. It roughly began at what we would call the A above middle C, and descended two octaves. Using the diatonic genus (a descending pattern of WWH), the notes would approximately correspond to (I'll surround tetrachords in parenthesis):
(a g f (e) d c B) (A G F (E) D C B,) A,