I have tuples of numbers $(x_{i,a})_{1\leq a \leq M, 1\leq i \leq n}, (x_{i})_{1\leq i \leq n}\subseteq [0,1]$ satisfying the following, for some fixed parameter $\beta \in (0,1)$: $$ \begin{align} \sum_{i=1}^n x_{i} &= 1 & \\ \sum_{a=1}^M x_{i,a} &= x_i, &\forall i \in \{1,\dots,n\} \\ \sum_{i=1}^n x_{i,a} &= \beta, &\forall a \in \{1,\dots,M\} \\ \end{align} $$ so in particular $0 \leq x_{i,a} \leq \min(\beta, x_i)$ for all $i,a$.
I am trying to obtain the best possible bound on the expression $$ \sum_{1\leq a,b\leq M} \left(\sum_{i=1}^n x_{i,a}x_{i,b}\right)^2 $$ in terms of $\beta$ and norms of the vector $x=(x_1,\dots, x_n)$. For instance, I can write $$ \begin{align} \sum_{1\leq a,b\leq M} \left(\sum_{i=1}^n x_{i,a}x_{i,b}\right)\left(\sum_{j=1}^n x_{j,a}x_{j,b}\right) &\leq \sum_{1\leq a,b\leq M} \left(\sum_{i=1}^n x_{i,a}x_{i,b}\right)\left(\max_{j}x_{j,b}\sum_{j=1}^n x_{j,a}\right) \\ &\leq \sum_{1\leq a,b\leq M} \left(\sum_{i=1}^n x_{i,a}x_{i,b}\right)\left(\max_{j}x_{j}\cdot \beta\right)\\ &=\beta\lVert x\rVert_\infty \sum_{1\leq a,b\leq M} \left(\sum_{i=1}^n x_{i,a}x_{i,b}\right) \\ &=\beta\lVert x\rVert_\infty \sum_{i=1}^n\left(\sum_{a=1}^M x_{i,a}\right)^2 =\beta\lVert x\rVert_\infty \sum_{i=1}^nx_i^2 \end{align} $$ obtaining the upper bound $\beta\lVert x\rVert_\infty \lVert x\rVert_2^2$. But this is not good enough for my purposes (the factor $\lVert x\rVert_\infty$ is too big, ideally I'd like it either squared or getting only powers of $\lVert x\rVert_2$).
The above is tantamount to using Holder's inequality (for $(1,\infty)$), but I do lose a lot on the assumptions when goind to $\max_{j} x_{j,b}$ and then $\max_{j} x_{j}$. Is there a tighter way to do it? Or an alternative way to "massage" the terms?