If you did a continuous on off keying of a 10101010... pattern, then you would see sidebands as described since this is simply an up-conversion of the Fourier Transform of a 50% duty cycle square wave (moved to any carrier frequency). However if the data pattern for this case of a rectangular on-off keying was random, the resulting spectrum would be continuous and under the envelope of a Sinc function (Sinc squared as a power spectrum). The first case itself is also under the envelope of the same Sinc function in frequency, but since the repetition rate of the underlying pattern was not random (in this case the single pulse on off cycle) and repeated at a specific repetition rate, only integer harmonics of that repetition rate can be in the spectrum, with all the even harmonics falling on the nulls of the Sinc envelope (and thus a square wave with 50% duty cycle only has odd order harmonics).
This is demonstrated below, showing a single rectangular pulse and the magnitude (in dB) of its Fourier Transform. If this was a carrier frequency turned on and off, the same spectrum would result just at that particular carrier (DC is just another carrier frequency). When we repeat that pulse in time at a periodic rate, the spectrum can only have non-zero content at integer multiples of that periodic rate (just as implied with the Fourier Series Expansion), but will still be within the envelope of the base pulse (in this case a Sinc function). So in the second case it is repeated at a 50% duty cycle, such that the even harmonics are in the nulls of the Sinc (the waveform repeats at $1/(2T)$). The third case is the same pulse duration repeating at a 25% duty cycle, so the 4th harmonic lands on the first null (with the waveform repeating at $1/(4T)$).
For example, if we generated a long pseudo-random sequence of such pulses with a pattern that repeats once per second, with each pulse having a duration of 1 millisecond, we would see spectral lines every 1 Hz under the envelope of a Sinc function with it's nulls at 1 KHz spacing. Thus we see in the extreme case of a random pattern that never repeats, that the spectrum will again be continuous such as in the first case of a single pulse (with the primary difference that it will be a power spectrum rather than an energy spectrum since if the pulse continues for all time, it will have infinite energy but finite power).