Fourier Series Concept
The function is an impulse, which is a vanishingly narrow pulse centered at t=0, but with finite area, in the time domain.

So the interpretation is that the Fourier transform of the impulse is the sum of an infinite number of cosines at different frequencies that cancel out everywhere except at t=0.   

In the case of the non-ideal rectangular pulse, the cosines have to add up to the rectangular pulse around t=0 and nowhere else. The pulse only happens once, so the center frequency is zero.