Nature of spacetime interval So, in the case of special relativity, we look for transformations relating inertial coordinates that leave the spacetime interval invariant and these transformations turn out to be generated by three Lorentz boosts and three spatial rotations.
But at the same time, I couldn't understand why does this count as a restriction as the spacetime interval is supposed to be a scalar (it has two covariant indices that come from the metric and two covariant indices).
Now for any coordinate transformation, a scalar shouldn't change. Therefore, the invariance of the spacetime interval should be an obvious deduction, given that it is a scalar and not a constraint imposed by Lorentz transformations.
I am sure that there is some mistake in this interpretation, could someone point it out?
Edit:  So, we look for transformations that leave the spacetime interval invariant.
If I write in index notation: $$ dS^2 = \eta_{\mu\nu}dx^{\mu}dx^{\nu} $$
Now suppose under a coordinate transform, $$ x^{\mu} \rightarrow x^{\mu'}=\Lambda^{\mu}_{\nu}x^{\nu}$$
$$dS^2 \rightarrow dS'^2 = \eta_{\mu'\nu'}dx^{\mu'}dx^{\nu'}$$
For the speed of light to be invariant as we go from one inertial frame to another, we demand that these transformations be such that, $$dS^2 = dS'^2$$
The condition we get from this, $$\Lambda^T\eta\Lambda = \eta$$
This characterises Lorentz transformations.  But my confusion is the following:
Saying, $dS^2 = dS'^2$, to me seems like something that should be always true since it is a scalar.  How is it different from saying $\Phi(x^{\mu}) = \Phi'(x^{\mu'})$, where $\Phi$ is a scalar-valued function.
Edit2: Am I already restricting the coordinate transformations I can take if I demand, $\Phi(x^{\mu}) = \Phi'(x^{\mu'})$?
 A: You are completely correct that the invariance of the spacetime interval under any arbitrary coordinate transformation follows from the fact that it is a scalar in a (pseudo) Riemannian manifold. As such the mere invariance of the spacetime interval places no restrictions on the allowable coordinate transformations and therefore cannot be used to derive the Lorentz transform.
Therefore, the invariance of the spacetime interval is not the property used to derive the Lorentz transform. The key property is not just the invariance of the interval, but the invariance of the form of the interval. In other words, we require not only $ds^2=ds’^2$ but instead we require $-dt^2+dx^2+dy^2+dz^2=-dt’^2+dx’^2+dy’^2+dz’^2$ which is a much stronger condition.
For example, a transformation of the spatial coordinates to polar coordinates satisfies the former property, as expected, but it violates the latter condition and therefore is not a Lorentz transform.
Edit: Now, in your edit you post some derivation that confuses you. There are two points which are leading to the confusion.
First, for a general coordinate transform you should write $ds’^2=g_{\mu’\nu’}dx^{\mu’}dx^{\nu’}$ because at this point you have not proven that the metric has the Minkowski form. And in fact for a general coordinate transform it does not (consider for example a spatial rotation).
Second, by rewriting the above it becomes immediately apparent that we do not get the condition $\Lambda^T \eta \Lambda = \eta$ from the invariance of the interval. This condition now must be added and doing so allows us to place restrictions on $\Lambda$ in order to obtain the Lorentz transform.
A: It seems that you think the Lorentz transformations is a result of requiring the spacetime interval to be invariant.
It is actually the other way round. The spacetime interval being invariant is  a result obtained from the Lorentz Transformations.
While the  Lorentz Transformations is a result of the speed of light having the same value $c$ in all inertial frames.
Thus the chain of thought should be like this:
Speed of light same in all inertial frames $\rightarrow$  Lorentz Transformations $\rightarrow$ Spacetime interval invariant under Lorentz Transformations.
