Wikipedia defines a diatonic scale like so:
In music theory, a diatonic scale is a heptatonic scale that includes five whole steps and two half steps in each octave, in which the two half steps are separated from each other by either two or three whole steps, depending on their position in the scale. This pattern ensures that, in a diatonic scale spanning more than one octave, all the half steps are maximally separated from each other (i.e. separated by at least two whole steps).
This is pretty clear. A diatonic scale is a subset of the twelve notes of the octave (in the system of 12-EDO). But what I want to know is why this particular pattern? Why heptatonic? Why must semitones be maximally separated? Why are only two allowed? Is there anything special about this configuration? I guess what I'm asking is where the diatonic falls out of something more fundamental, or is it just a particular choice? Or perhaps I'm looking at it backwards, is the diatonic in some sense prior to the chromatic scale?
The reason why I ask is that I want to know, if the diatonic scale is a consequence of something more fundamental, whether there are analogues of it in other divisions of the octave, for example 19, 22, or 31 EDO?