OK, so the questions is "Why are there parts of the linac which are not used for accelerating the particles?".
That is a good question and may not be obvious.
The diagrams in the question show an early stage of the accelerator. At this point the particles are still non-relativistic or only slightly relativistic which means that the speed of the particle changes as it gets more energy.
Couple that with the fact that the accelerating potential is provided by a single radio-frequency signal and the accelerating regions have to be a further apart as the particles move down the tube (because they are going faster, but the time to switch polarity of the signal is a constant set by the frequency of the RF).
If you were accelerating a single particle, then in principle each drift tube could be a thin collar of conductor, but because you are managing a "bunch" that may be spread out along the axis of the beam those outliers could be in either the next or previous cell where the field is reversed relative the desired direction. To prevent that the drift tubes are engineered to arrange a low field region between each accelerating region and ensure that the entire bunch gets a push in the right direction. (In fact, it is possible and desirable to arrange for the leaders to get a little less push and the laggards to get a little more so that the bunches get tighter as you go along.)
General consideration later on
A "beam" in a typical accelerator is not uniform, but consists of a bunch a "bunches" and moves in a high-quality, laboratory vacuum. So, what is a bunch? It is a number of charged particles (whatever makes up the beam) close to one another. These particles are subject to the Coulomb force and they try to move away from one another. If that happens the beam will grow ever larger and eventually crash into the walls of the beam tube.
To prevent that the beam has to be passed though quadrupole magnets from time to time. These take up space on the beamline (and it is much easier and cheaper to have separate magnets and cavities than to try to engineer them into a single unit).
The beam also needs to be steered to keep it on course and may need to be turned (because even "linear" accelerators have bends in places). This requires dipole magnets. Again these are separate from the cavities, though in some cases people do build combined dipole and quadrupole magnets; the Fermilab logo is a diagram on the field lines in such a "hexapole".
You also need to instrument the beam for current, beams size, halo, position and so on. All of those instruments take up space along the beam line.
So the short answer is "We use all the beam line that is available."
Why the beam moves at constant speed when not being accelerated is just Newton's first law.
The reason the bunches are spaced so that they exist in every-other acceleration region (called cavities) is because the acceleration is provided by a radio-frequency signal. Every other cavity has it's field pointing the wrong way (i.e. to decelerate the beam).