Killing yourself is selfish; but there's nothing that isn't selfish. Most of the time people try to find a "non-egoistic" excuse for doing something.
It maybe very very simple or infinitely complex: people may try to convince others that their intentions don't include their own well-being ("I always work harder than I should so our company can thrive" when In fact it simply means "I want a promotion") or they may even try to convince themselves that they are not selfish (a person regularly feeds homeless people, without telling anyone about it; he or she feels a rush of relief: "Now I know, I am a good person.")
Anything you do is done in order to either feel good (between "comfortable" and "orgasmic") or to stop feeling bad (between "slightly unpleasant" and "agony"). You will never do something just because you can do it. And if you do something "just because you can", then it simply brings you joy knowing that you have an ability to do something, no matter how helpful, harmful or silly this action is.
Still: why suicide is the most selfish act?
I have a few versions.
1) With suicide, there's little to no direct impact on the outer world: YOU just did something to YOURSELF and that's it. Of course, lots of different things follow the same formula, but after suicide no one can call you out because there's no you. No one can say "hey, why did you kill yourself, %username%? why don't you go and do something more productive?".
2) Glorification of "heroic" suicide (when people sacrifice themselves to save others) makes other cases of suicide look like a waste.
3) My favorite: people are afraid of death and calling suicide "selfish" is a coping mechanism. No one wants to think about actual reasoning behind such an act. Maybe it's because someone doesn't want to accept that death is a way out; maybe because thinking about death in general is very scary, and inevitability of death is a pure nightmare fuel. So instead of trying to understand why could someone commit suicide, it's much easier to label it as something unpleasant like "weakness" or an "easy way out" or, well, "selfish act", and call it a day. And you aren't a weak egocentric pussy, right?