Zero-Padding seems to CHANGE FFT of signal!
Your problem is these two lines:

t=(1:L)*(1/Fs);
f=(1:L)*df;


They should read:

t=(0:L-1)*(1/Fs);
f=(0:L-1)*df;


If I modify your script as below (for scilab, not matlab), I get the following plot.  The peaks all line up correctly.

And the peak of the FFT is at 0.25 not 0.3125.





for ZP=0:5       // of times of original length of signal to ZP with

    x=[0 1 0 1 0 1 0 1]; 
    x=[x,zeros(1,length(x)*2^ZP-length(x))];
    X=fft(x);

    Fs=1;
    L=length(x);
    df=.5*Fs/L;    
    t=(0:L-1)*(1/Fs);
    f=(0:L-1)*df;

    figure; 
    subplot(211), plot(x);
    subplot(212), plot(f,abs(X)); //xlim([-.02,.52])

    test_pnt=.3125;
    I=find(f==test_pnt);
    title('abs[X(' + string(test_pnt) +']='+ string(abs(X(I))));

end;