For example,
$3=3I$
$=3\begin{bmatrix} 1 & 0 \\ 0 &1 \\ \end{bmatrix}$
$=\begin{bmatrix} 3 & 0 \\ 0 &3 \\ \end{bmatrix}$
and $\begin{vmatrix} 3 & 0 \\ 0 & 3 \\ \end{vmatrix}=9$
Does this mean $3=9$ ? Am I confusing determinant with "value of matrix"?
If you know already that you're working with linear transformations of a particular vector space (which form an associative algebra over the scalar field), then it is customary to write simply $3$ for the transformation that multiplies every vector by $3$, which is the same as $3I$.
So if that is your context, then $3$ and $3I$ is the same thing. That doesn't mean that the matrix $3I$ is the same as the number three, just that the symbol "$3$" is sometimes used to denote that matrix in addition to the number.
But the real problem in your calculation is where you apparently conclude from $|3I|=9$ that $3I=9$.
A matrix is not equal to its determinant -- you're getting those determinant bars out of nowhere, and you have no right to assume that $A=|A|$ even in a context where you use bare numbers as shorthand for certain matrices.
If it's given that you're working in the algebra of linear transformations of $\mathbb R^2$, then the best the various abbreviations will let you conclude is $$ \det(3) = 9 $$ which looks strange but is not the kind of contradiction that $3=9$ is.