Getting different FFT results in LTspice comparing to MATLAB and Python
Despite the fixed timings provided by the PWL file, LTspice is a SPICE engine, analog simulator, which means the simulation will not have even steps. In Matlab and Python, you can correctly account for the exact samples that are described in the definition. LTspice needs to simulate it, so, like all analog SPICE engines, it has an uneven time.

You could increase the timestep and/or add .opt plotwinsize=0, numdgt=15, which will improve the result. See if that helps.

[edit] However, no matter what you do, LTspice will show RMS values in the FFT window (unlike with the .four command).[/edit]



Here's my attempt by using the above (timestep 25u):



Seems quite close to the Python version. In LTspice FFT I used 24000 points and set "Number of points" to 1 (polynomial smoothing).