Your lecturer calculated the remainder when $5a^2$ is divided by $12$, for $a=0$ to $11$. Actually we can stop at $6$, since for any $a$ we have $(12-a)^2\equiv a^2\pmod{12}$. (Indeed we could stop at $a=3$, since $(6-a)^2\equiv a^2\pmod{12}$.)
So calculating from $0$ to $6$, we find that modulo $12$, $5y^2$ can take on values $0,5,8,9, 8, 5,0$.
Now suppose that $24x^n+5y^2=15$. Then, modulo $12$, we have $5y^2\equiv 3$. That is impossible, since $3$ is not in our list of possible remainders when $5a^2$ is divided by $12$.
Remark: It is simpler to work modulo $4$. If $(x,y)$ is a solution of our equation, then $5y^2\equiv 3\pmod{4}$. That cannot happen if $y$ is even. And if $x\equiv \pm 1\pmod{4}$, then $5x^2\equiv 1\pmod{4}$, contradicting the fact that $5y^2\equiv 3\pmod{3}$.