TL; DR There is no faithful unitary representation of a non-compact Lie group that realizes it as a closed Lie subgroup of some $U(n)$.
First of all, it's not true that a non-compact group can't have unitary representations. Because what is a unitary representation? It's simply a homomorphism into some $U(n)$ that then acts linearly on an $n$-dimensional vector space (in other words, a unitary representation factors through a unitary group). So we want to find a smooth homomorphisms into $U(n)$ from non-compact groups. But they clearly exist! For example $\rho : (\mathbb R, +) \to U(1), x \mapsto \exp(2\pi ix)$ is such.
The correct statement you are after (I think) is that it's not possible to find a faithful unitary representation. That is, a homomorphism that doesn't map any element of $G$ to identity of $U(n)$ (note that $\rho$ above sends $\mathbb Z$ to $1$). Altogether, we want to smoothly embed $G$ as a Lie subgroup of $U(n)$ (there are caveats here regarding words such as immersion, embedding and smooth structure that I don't want to get into).
Let $\psi : G \to U(n)$ be a continuous homomorphism. Suppose $\psi(G)$ is closed in $U(n)$. Then it is compact (since $U(n)$ is) and since this is to be homeomorphic to $G$, $G$ must be compact as well.
Note that not every subgroup of a Lie group needs to be closed. For example the line of an irational slope in the $U(1) \times U(1)$ (a torus) is a subgroup, isomorphic and homeomorphic to $\mathbb R$ whose closure is all of $U(1) \times U(1)$. So there remains a possibility of finding a homomorphism with a non-closed image. This, for a general $G$ other than $\mathbb R$, seems like a very hard task, but I don't see any way of excluding this possibility and am actually pretty sure these examples do exist. But I'm quite of my depth here, so that's it from me.