In Alan Agresti's Categorical Data Analysis, page 344, when talk about loglinear models, it says that given $Y$ jointly independent of $X$ and $Z$, we can conclude that 1). $X$ and $Y$ conditionally independent given $Z$, and 2). $X$ and $Y$ marginally independent.
For 1), it is easy to see when writing down its loglinear model, but how to prove 2)?
If you mean $Y$ is independent of the pair $(X,Z),$ one thing to recall is a lemma that says if $Y$ and $W$ are independent, then $Y$ and $f(W)$ are independent if $f$ is any (measurable) function at all. Let $W=(X,Z)$ and let $f(W)= f(X,Z) = X.$
To prove the lemma, proceed as follows: \begin{align} \Pr(Y\in A\ \&\ f(W)\in B) = {} & \Pr(Y\in A\ \&\ W\in f^{-1}(B)) \\ & \text{where $f^{-1}(B) = \{x : f(x) \in B\}$ } \\[10pt] = {} & \Pr(Y\in A) \Pr(W\in f^{-1}(B)) \\[10pt] = {} & \Pr(Y\in A) \Pr(f(W)\in B). \end{align}