$\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, $M_\vpi(C)$ will not be compact wrt to the TV metric for any real-valued measurable function $\vpi$ and real $C>0$. Indeed, for natural $N$, consider the set $E_N:=\{x\in\R\colon |\vpi(x)|\le N\}$. Then $(E_N)$ is an increasing sequence of sets such that $\bigcup_{N=1}^\infty E_N=\R$. So, for some natural $N$, the Lebesgue measure $L:=|E_N|$ of $E_N$ is $>0$. For these $N$ and $L$ and for each natural $n\ge n_*:=NL/C$, partition the set $E_N$ into $n$ sets $E_{n,1},\dots,E_{n,n}$ each of measure $L/n$. Take any such $n$ and let $\mu_{n,1},\dots,\mu_{n,n}$ be the uniform distributions on the respective sets $E_{n,1},\dots,E_{n,n}$. Then for each $i\in[n]:=\{1,\dots,n\}$ we have $$\int_\R\vpi\,d\mu_{n,i}\le NL/n\le C,$$ so that $\mu_{n,i}\in M_\vpi(C)$. Note next that for each natural $n\ge n_*$ and any distinct $i$ and $j$ in $[n]$, the TV distance between $\mu_{n,i}$ and $\mu_{n,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