$\newcommand\vpi\varphi\newcommand\ep\varepsilon\newcommand\R{\Bbb R}$What you "need to show" is of course false in general. E.g., suppose that $d=1$ and $\varphi=1_{[0,1]}$. Then your set of measures, say $M_\vpi(C)$, is [not compact even in the topology of weak convergence][1], since the the sequence of the uniform distributions over the intervals $[n,n+1]$ for natural $n$ is not tight. --- If $\vpi\ge0$ and $\vpi(x)\to\infty$ as $|x|\to\infty$, then the set $M_\vpi(C)$ will be compact in the topology of weak convergence, because it will be tight. Indeed, for each real $\ep>0$, let $x_\ep>0$ be a real number such that $\vpi(x)\ge C/\ep$ if $x\notin K_\ep:=[-x_\ep,x_\ep]$. Then for each $\mu\in M_\vpi(C)$ we have $$C\ge\int_{\R\setminus K_\ep}\vpi\,d\mu\ge\frac C\ep\,\mu(\R\setminus K_\ep)$$ and hence $\mu(\R\setminus K_\ep)\le\ep$. $\quad\Box$ --- On the other hand, for any real-valued measurable function $\vpi$ whatsoever and some real $C=C_\vpi>0$, the set $M_\vpi(C)$ will not be compact wrt to the TV metric. Indeed, for natural $C$, consider the set $E_C:=\{x\in\R\colon |\vpi(x)|\le C\}$. Then $(E_C)$ is an increasing sequence of sets such that $\bigcup_{C=1}^\infty E_C=\R$. So, for some natural $C=C_\vpi$, the Lebesgue measure of $E_C$ is $>0$. For this $C$, partition the set $D:=E_C$ into countably many sets $D_1,D_2,\dots$ each of measure $>0$. Let $\mu_1,\mu_2,\dots$ be the uniform distributions over the respective sets $D_1,D_2,\dots$. Then for each natural $i$ we have $$\int_\R\vpi\,d\mu_i\le \int_\R C\,d\mu_i\le C,$$ so that $\mu_i\in M_\vpi(C)$. Note next that for any distinct natural $i$ and $j$, the TV distance between $\mu_i$ and $\mu_j$ is $1$. So, the set $M_\vpi(C)$ is not totally bounded wrt the TV metric and therefore not compact wrt to the TV metric. $\quad\Box$ [1]: https://en.wikipedia.org/wiki/Prokhorov%27s_theorem