Indeed, if we simply ignore what happens at the endpoints, obviously every exponential $x\rightarrow e^{c\cdot x}$ is an eigenfunction for $\Delta=-d^2/dx^2$. In effect, this amounts to looking at the open (=non-compact) interval, and, further, in this situation the operator is not self-adjoint, so no wonder that we cannot argue that its eigenvalues are real, etc., not even mentioning the non-discreteness.
To make a self-adjoint operator, something must be done with the endpoints. There is not a unique choice. One choice is requiring that values and values of derivatives match at the ends of the interval, so, in effect, we are looking at a circle. The eigenfunctions are exponentials whose values match at endpoints are $x\rightarrow e^{inx}$ with integer $n$, as expected, with a discrete set of real eigenvalues.
Or, we can choose the Dirichlet problem, that is, vanishing at the boundary, the endpoints. This gives eigenfunctions $x\rightarrow \sin {n\over 2} x\;$ with integer $n$, with a discrete set of real eigenvalues.
In fact, there is a continuum of distinct boundary conditions which make $\Delta$ self-adjoint: the literal requirement is that in integration by parts the boundary contributions cancel themselves. This gives relations on the values and derivatives at endpoints, met by the two examples mentioned, but met by many more, as well.