You are totally right that the maximum modulus principle says
$$\max_{|z|\leq1}|f(z)|\leq \max_{|z|=1}|f(z)|$$
and also, by the triangle inequality,
$$\max_{|z|\leq1}|f(z)|\leq |a_0|+|a_1|+\cdots+|a_n|.\tag{1}$$
where $$f(z)=a_0z^n+a_1z^{n-1}+\cdots+a_n$$
is a polynomial.
Moreover,
$$\sup_{|z|<1}|f(z)|\leq \sum_{n=0}^\infty |a_n| $$
for any analytic function
$f(z)=\sum_na_nz^n$.
In our case, as you noticed,
(1) tell us that
$$\sup_{|z|<1}|f(z)|\leq3.
\tag{2}$$ where $f(z)=2z^2-1$.
Moreover, it is rather easy to guess a point $z_0$ (or two) where we have equality in (2).
Hence, we really do have the equality $$\sup_{|z|<1}|f(z)|=3.$$
However, in general we cannot get equality in (1), which is easiest realized by an example.
Consider the polynomial $g(z)=(z+1)(z^2-1)=z^3+z^2-z-1$. Then the right hand side of (1) imply
$$\sup_{|z|\leq1}|g(z)|=4.$$
Next, the maximum modulus principle say $$\sup_{|z|\leq1}|g(z)|\leq\sup_{|z|=1}|z+1|\cdot|z^2-1|$$
which is bounded by $2\cdot2$.
However, the maximum of the first factor, $|z+1|$, is (only) attained at $z=1$, but then the second factor, $|z^2-1|$, is zero.
That is $$\sup_{|z|\leq1}|g(z)|<4.$$