Presumably you're setting
BASH_ENV in your
.bashrc. Bash loads
.bashrc when it's interactive and not a login shell, or when it's a login shell that's invoked by rshd or (in many distributions, but it's a compile-time option) sshd. That's too late for this instance of bash. Put the commands directly in
if [[ $- = *i* ]]; then
# Commands for interactive use: prompt, aliases, key bindings, etc.
# Don't set environment variables here, that goes in .profile.
# Commands executed only on remote logins.
# You can set environment variables here. Do not output anything.
If you only need to set environment variables, you can use
~/.pam_environment instead, which is used for any kind of login. See What's the best distro/shell-agnostic way to set environment variables?
For other ways to execute commands when logging in non-interactively over SSH, see sh startup files over ssh