Because you're using the wrong quotation mark. What you're looking for is the backtick: ` not the single quote: '
If you want something easier to discern, you can use $() instead. It does the same thing, and also supports nesting, which the backtick does not.
So:
Code:
for temp in `ls -d */`
do
cd $temp
done
or
Code:
for temp in $(ls -d */)
do
cd $temp
done
or, without the command substitution, and without unnecessarily running ls:
Code:
for temp in */
do
cd $temp
done