I'd say it's a little bit of both.

I had very good cyclists pass me uphills on their heavy 7-speed downhill bikes. Obviously if you are in very very good shape, you can still do great on a crappy bike.

On the other hand, there are hills that I could not climb on my commuter bike because it's too heavy and the geometry just isn't right that I have no problem with on my MTB. A friend of mine once switched his tires for ones that where more suited for downhill trails - he just couldn't get up the hills we used to ride because they where so heavy. So a the bike setup/a good bike does make a difference.

When riding with less experienced riders it usually helps if the slower rider has the better bike. I always ask my riding partners if they want to swap bikes if they are slower than me (most of the times however I am the one that rides the lightest "best" bike so that I can keep up with my male cycling friends). Or I try to stay behind them. Or at least I wait for them every now and then and tell them that they do a great job with such a heavy bike.

What your friend does is not nice and I understand that this isn't fun for you. I am not sure if the bike makes you feel bad or your friend.
If you think that you would enjoy cycling more with a new bike - get one it will be fun
If it is more you friend that makes you feel bad, maybe just ride by yourself or with someone else