First, by the rearrangement inequality, the sum on the right side is maximized when $x_i$'s are arranged in ascending order. Thus, it suffices to show the case with $x_1 \le x_2 \le \cdots \le x_n$. In other words, we wish to show
$$
(1+a_n)(x_1 + \cdots + x_n)^2
\ge
2 \, n \, x_1 \, (a_1 \, x_1 + \cdots + a_n \, x_n).
$$
Second, suppose $x_2 > x_1$, we can replace $x_n$ by $x_n + x_2 - x_1$, and then replace $x_2$ by $x_1$. This would leave sum $x_1 + \cdots + x_n$ unchanged, while increasing the sum on the right-hand side. We can also do this for $x_3, \dots, x_{n-1}$. This means we only need to show the case with $x_1 = x_2 = \cdots = x_{n-1} \le x_n$. Define $\Delta \equiv x_n - x_1$, we only need to show that
\begin{align}
(1+a_n)(n \, x_1 + \Delta)^2
\ge
2 \, n \, x_1 \, (a_1 \, x_1 + \cdots + a_n \, x_1 + a_n \, \Delta) \\
=
2 \, n \, x_1 \, \left[
\frac{1}{2}(1 + a_n) \, n \, x_1 + a_n \, \Delta\right].
\end{align}
But this inequality is obvious, for
\begin{align}
(1+a_n)(n \, x_1 + \Delta)^2
&=
(1 + a_n) \, n \, x_1 \, n \, x_1
+2 (1 + a_n) \, n \, x_1 \, \Delta
+ (1 + a_n) \, \Delta^2 \\
&\ge
\frac 1 2 (1 + a_n) 2 \, n \, x_1 \, n \, x_1
+2 \, a_n \, n \, x_1 \, \Delta \\
&=2 \, n \, x_1 \left[
\frac{1}{2}(1+a_n) \, n \, x_1 + a_n \, \Delta
\right].
\end{align}
Q.E.D.