Fourier transform - LTSpice
This is beyond the capablities of circuit simulators. The simulators handle only finite length signal bursts. You will not get the same spectrum, because the signal in your example is the theoretical sinewave which has never started and will never stop. It has existed unchanged from t = -eternity and will go on to t = +eternity. It has infinite energy, so it occurs as Dirac's impulses in the Fourier transform.

Simulators calculate the discrete fourier transform. It's said FFT due the used high-speed calculation algorithm. It shows the signal as it were combined from sinewaves which have frequencies 0, 1/T, 2/T, 3/T...Fsample/2 where T is the simulation period and Fsample is the used sample rate.

If your sample rate in the simulation happens to be an integral part of the cycle length of the sinewave and the simulation time period happens to be an integral multiple of the cycle length and no automatic smooth windowing spoils the start and end, then you get something that resembles your theoretical spectrum. It will not be strictly 2 spikes. The numeric rounding errors occur as a noise floor (=extra frequency components) in the spectrum. The energy of the spectrum only will be not infite, but the total energy of the sinewave in the simulation period.

Unfortunately I have not LTspice and do not know, how to order the right Fourier transform mode (=rectangular windowing, show positive and negative frequencies and the phase angles).