How do I use ls command with a variable for a directory in zsh?
You don't show how you assign the variable in the first place, but usually issues with ~ in variables come from the way you quote (or don't quote) during assignment. To make it work you need to omit quotes when assigning ~ to a variable.

$ foo=~
$ echo $foo
/Users/pse
$ foo="~"
$ echo $foo
~
$ ls $foo
ls: ~: No such file or directory