Usually I hear 'temperament' used in the sense of 'Meantone temperament' or 'Well temperament'- which are as Wikipedia says, tuning systems that "slightly compromise the pure intervals of just intonation to meet other requirements." In other words, they are 'tweaks' to, or 'specifically-pitched versions of', an already-defined scale such as the Major / diatonic scale.
This "in other words" restatement seems to equate "the pure intervals of just intonation" with "an already-defined scale." But there is no reason why a scale, taken alone, should necessarily have any reference to just intervals. Just intervals are useful as harmonic intervals, while scales may be concerned only with melodic intervals. This is one reason why so many scales from various musical traditions comprise intervals that are not in just ratios: when a scale is not used harmonically, it does not matter whether its notes are pleasant when sounded at the same time.
Temperament is the compromise that arises when one tries to create a scale that works within certain restrictions. When different contexts call for the same note to be played at a different pitch, but the nature of the instrument dictates that the pitch of the note cannot actually be varied, compromise is necessary.
In European classical music, the restrictions are commonly harmonic. This is usually illustrated with the impossibility of closing the circle of fifths, because (3/2)12 is 129.746 while 27 is 128; the circle of fifths ends up 23.46 cents sharp.
Ïn 5-limit just intonation, however, which calls for "pure" major thirds in a 5:4 ratio, the problem arises much more rapidly. In fact, not really possible to define the major scale in just intonation if the notes of the scale will be used harmonically.
Consider a keyboard with just seven pitches, c, d, e, f, g, a, and b. We want to tune it so the perfect fourths and fifths are in the ratio 4:3 and 3:2, respectively, and the major thirds are in the ratio 5:4. Our fundamental C is 264 Hz. Here are E and G:
Desired | Source | Source
Pitch | Pitch | Frequency | Ratio | Result
--------|--------|-----------|-------|--------
E | C | 264 Hz. | 5:4 | 330 Hz.
G | C | 264 Hz. | 3:2 | 396 Hz.
There is the C major chord. Next, the dominant, working from G=396. Remember that the keyboard has only seven keys, so the D will be a fourth below the G at a ratio of 3:4 (instead of a fifth above at a ratio of 3:2):
Desired | Source | Source
Pitch | Pitch | Frequency | Ratio | Result
--------|--------|-----------|-------|-------
B | G | 396 Hz | 5:4 | 495 Hz
D | G | 396 Hz | 3:4 | 297 Hz
Let's check something here: when we defined B, we didn't only create a major third with G, but also a fifth with E. (We don't need to check the D against the G because we derived the D from the G to start with.) Are the B and the E in the correct relationship with one another?
Higher | Lower | Higher | Lower | Expected | Actual
Pitch | Pitch | Frequency | Frequency | Ratio | Ratio
-------|-------|-----------|-----------|----------|-------
B | E | 495 Hz | 330 Hz | 3:2 | 3:2
Fortunately, they are. Next, the subdominant, working from C=264:
Desired | Source | Source
Pitch | Pitch | Frequency | Ratio | Result
--------|--------|-----------|-------|-------
F | C | 264 Hz | 4:3 | 352 Hz
A | F | 352 Hz | 5:4 | 440 Hz
We don't need to check the F against C, because we derived it from C, but let's check the A against D:
Higher | Lower | Higher | Lower | Expected | Actual
Pitch | Pitch | Frequency | Frequency | Ratio | Ratio
-------|-------|-----------|-----------|----------|-------
A | D | 440 Hz | 297 Hz | 3:2 | 40:27
Oops! If we divide 40:27 by 3:2, we get 80:81. To get the perfect fifth above 297 Hz, we can multiply 440 Hz by 81:80, yielding 445.5 Hz, which is of course also the result of multiplying 297 by 3:2. The lower A at 440 Hz in fact beats quite unpleasantly against the D at 297 Hz.
The problem here is not the inconsistency between twelve fifths and seven octaves, but that between four fifths and one major third (plus two octaves). Since that difference is the syntonic comma, we can flatten each of the four fifths by a quarter of a syntonic comma to yield a pure third. This gives quarter-comma meantone temperament, and we didn't even need to think about other keys or chromatic notes before we found a need for it.
On the other hand, if you will never play the A at the same time as an F or a D, none of this is in the least problematic, and temperament would be quite unnecessary.