I propose doing this with the changepage package. With option strict as used below, it uses LaTeX labels in order to circumvent the asynchronous nature of TeX typesetting;1 therefore, at least two compilations are needed:
\documentclass{article}
\usepackage{datatool}
\usepackage{filecontents}
\usepackage[strict]{changepage}
\begin{filecontents*}{test2.csv}
Acol, Bcol
Ax,Bx
Ay,By
A1,B22
A2,B44
A3,B11
\end{filecontents*}
\DTLloaddb{mydata}{test2.csv}
\newlength{\lengthForOddPages}
\newlength{\lengthForEvenPages}
\setlength{\lengthForOddPages}{5cm}
\setlength{\lengthForEvenPages}{10cm}
\newcommand*{\pageDependent}{%
\ifoddpage
\expandafter
\lengthForOddPages
\else
\expandafter
\lengthForEvenPages
\fi
}
\begin{document}
\DTLforeach*{mydata}{\A=Acol,\B=Bcol}%
{%
\A \checkoddpage\hspace{\pageDependent} \B
\newpage
}%
\end{document}
Of course, you could also define \pageDependent this way:
\newcommand*{\pageDependent}{\ifoddpage 5cm\else 10cm\fi\relax}
in case you don't want the indirection. The \relax will stop TeX's 〈glue〉-reading process. Otherwise, in some contexts where TeX is reading a 〈glue〉,2 particular inputs such as \pageDependent plus ... or \pageDependent minus ... could expand the ... looking for stretch or shrink components of the 〈glue〉 starting with the expansion of \pageDependent (this can happen even if plus and minus aren't written explicitly as here).
Footnotes
If you use \thepage directly inside a paragraph, it will expand to the number of the page TeX is currently working on, but as the paragraph may be split across several pages, the printed page number may differ from the actual page the result is written to. This is because the places where lines are broken, as well as the number of lines in a paragraph, aren't known until TeX has read and processed the whole paragraph. So, if the paragraph starts when TeX is working on page 9 but spans pages 9 and 10, a naive use of \thepage could print the number 9 on page 10. The technique using labels (as used by changepage with the strict option) prevents this problem from happening. Also, some commands such as \protected@write take care to expand \thepage late enough that its expansion does correspond to the actual page (this is thanks to how \write works as opposed to \immediate\write, and special handling of \thepage in the definition of \protected@write).
Not inside the argument of \hspace, though; so, there would be no problem even without \relax in this particular example.