I do not have an answer to the question of whether experimenting on nonhuman animals can be justified out of necessity. I have some thoughts, though:
Assume that in the near future, we give nonhuman animals the same moral value as humans. And then say we wanted to conduct an experiment on an animal to cure a human ailment. Before we harm a nonhuman animal, we need to ask whether we have the right to harm that animal. Because nonhuman animals and humans have the same moral value, this is equivalent to asking whether we would have the right to harm a human in the same position.
So right off the bat, our standard for conducting tests on animals is, "would we have the right to conduct this test on a human?"
Let's also assume that we believe humans must give consent before we have the right to conduct scientific experiments on them. If we apply this to animals, then we need to determine how to get consent from an animal, which seems hairy. And then there's the question of fairness -- if we've already determined that we have the right to perform this test on a human, and we're trying to cure a human ailment, then isn't it selfish to perform the experiment on a nonhuman animal?
But, you may say, what if the gains outweight the cost? If we truly believe that we will gain enough to justify violating the rights of a nonhuman animal, that's consistent with justly violating the rights of a human. And then the question of selfishness comes up again.
> I believe that much bigger issue eating meat, where reason why we cause huge amount of pain to animals comes mostly to , because it taste good.
I believe they are both big issues. My only advice is to be careful not to fall into the trap of classifying one as a less evil (even though it seems that harming animals for our enjoyment is much worse than harming them out of necessity). If we fight to recognize the moral value of nonhuman animals on all fronts, then the world you wish for (only performing experiments out of extreme necessity) will come too. (This is not a personal jab at you -- it's something I noticed in my own thinking, too.)