You have a new possibility perhaps interesting for you with pgf 2.1 (or with the last version of pgffor), you can use a new option count
. I create two counters \xi and \yi, automatically for each loop you get \xi=\xi+1 etc.
\documentclass{scrartcl}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[x=0.75cm,y=0.75cm]
\foreach \x [count=\xi] in {0,...,6}
{\foreach \y [count=\yi] in {0,...,6}
{\ifnum\xi=\yi
\node [draw, minimum size=0.666cm] at (\xi,-\yi) {$\infty$};
\else
\node [draw, minimum size=0.666cm] at (\xi,-\yi) {$\x\y$};
\fi }}
\end{tikzpicture}
\end{document}