@GeorgeMoutsopoulos You didn't get my point I think. If you look at Wikipedia:
en.wikipedia.org/wiki/Expected_value, you will see that expectations are taken
OF r.v.s $X$ (big capital letters), but
WITH RESPECT TO densities (in case of continuous r.v.s). The "with respect to" part is fine, it's the "of" part that is not fine. If r.v.s are taken of r.v.s, how can a likelihood (or density in general), such as $p(x \mid z)$, be the argument of the expected value operator $\mathbb{E}\left[ \cdot \right]$ and thus be a r.v. (assuming that expected values only take r.v.s as inputs)?