Sometimes, it is possible to combine $X$ and $Y$ to get stronger correlation with $Z$. For example, if $Z=X+Y$, then $\mathrm{corr}(X,Y)$ and $\mathrm{corr}(X,Z)$ might be small, but $\mathrm{corr}(X+Y,Z)=1$. However, sometimes no combination $f(X,Y)$ will be better correlated with $Z$ than $Y$.

To see this, suppose $U$, $X$ and $Z$ are all random variables over $\{0,1\}$, and consider all functions $\{0,1\}\times\{0,1\}\rightarrow\{0,1\}$, of which there are $2^4$. Take the function $f$ such that $f(U,X)$ is maximally correlated with $Z$, and define $Y:=f(U,X)$. Since every combination of $X$ and $Y$ can be viewed as a combination of $U$ and $X$, we know that $Y$ is the combination that's most correlated with $Z$.