All perfect praise be to Allaah, the Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
As long as you have performed your obligatory Hajj, it is permissible for you to perform Hajj on behalf of your late friend . If your friend had the ability to perform Hajj during his lifetime yet he did not perform it, it would have been obligatory to perform Hajj on his behalf from his own wealth. However, if you donate your own money to perform Hajj on his behalf in order to keep his wealth for his wife and children, then this would be a good deed for which you should be thanked, and that hopefully Allaah The Almighty will reward you for.
However, if your friend did not have the ability to perform Hajj during his lifetime, it would not be obligatory to perform Hajj on his behalf, rather it would simply be permissible, in which case it would be preferable for you to perform Hajj for yourself and supplicate for him as much as you can therein.
Allaah Knows best.