Because you are setting setDispatched(false)
, (I think) the action helper will be reinitialised for your login method, and so your ACL check will be run again. Since the condition will fail once more, ZF will again do an internal redirect to the login method, and the process repeats (hence infinite loop). The simplest fix is to add an additional condition so the check doesn't run for the login method itself:
if (!$this->_acl->isAllowed($role, $resource, $priv) && $request->getActionName() != 'login') {
[...]
}
If this doesn't work, see if commenting out the setDispatched check makes any difference.