As done in this question one can prove that $\sin(n\pi \cdot), n \ge 1$ is a orthonormal basis of $L^2([0,1])$.
We also have that $(-\Delta)( \sin(n\pi\cdot) )= (n\pi)^2 \sin(n\pi \cdot)$, which means that we can diagonalize $-\Delta$ w.r.t. $\sin(n \pi x)$ and have only positive eigenvalues.
From this I now conclude that $-\Delta$ is strictly positive on $L^2([0,1])$. This is a contradiction to the constants and the linear functions being in the kernel of $-\Delta$ and also in $L^2([0,1])$
The operator domain comes with endpoint conditions $f(0)=f(1)=0$. That eliminates constants from being in the domain of the operator, unless those constants are $0$. If you choose endpoint conditions $f'(0)=f'(1)=0$, then you end up with a new basis of eigenfunctions $\{1,\cos(\pi x),\cos(2\pi x),\cdots\}$.