Assume the contrary, let $1<q<p$ be a prime with $q\mid 2^n+1$. Then, $3^{(p-1)/2}\equiv -1\pmod{q}$ and $3^{p-1}\equiv 1\pmod{q}$. Letting $d$ to be the degree of $3$ modulo $q$, we get $d\mid p-1=2^n$ and $d\nmid (p-1)/2 = 2^{n-1}$. As a result, $d=2^n$. Furthermore, $3^{q-1}\equiv 1\pmod{q}$ by Fermat and that $d=2^n\mid q-1$. Thus $q\ge 2^n+1$, a contradiction.
In fact, more is true: let $p=2^n+1$. Then, $3^{(p-1)/2}\equiv -1\pmod{p}$ iff $p$ is a prime. To prove the if part also, note that $p$ being prime implies $n=2^k$. In particular, $p\equiv 1\pmod{4}$ and $p\equiv 5\pmod{6}$. Now by Euler's criterion, $3^{(p-1)/2}\equiv \pm (3/p)\pmod{p}$. Noting that $(3/p)=(-3/p)=-1$, we conclude.