Confusions on FFT of a square-wave in theory and in scope and simulation
Welcome to the real world!

The "mathematically perfect" transform you show at the top, with the "discrete" harmonics is generated assuming that the rise and fall times of the waveform are zero, and that you're doing a continuous transform &mdash; no discrete sampling in the time domain. It assumes that the integrations are over an infinite span &mdash; or equivalently, they're done over an exact whole number of cycles.

When you generate a waveform in a simulator, or feed a real waveform into an oscilloscope, these assumptions no longer hold. The rise and fall times have nonzero values, and the signal is sampled in the time domain. Most importantly, the sampling does not normally encompass an exact number of whole cycles, nor is it precisely synchronized to the waveform.

Violating these assumptions causes the peaks you see in the transform output to "spread out". This does not mean that there's any energy at, say 102 Hz, but only that the limitations of the algorithm means that it can't distinguish between whether or not there's energy there, given the limitations of the set of samples it is working with.