My supervisor wants me to include another professors name in my paper just because he was declared as my second adviser on the project. But the problem is that this man has not done anything but giving foolish and useless comments on my work. By foolish, I do not exaggerate since my supervisor thinks the same but it seems that he made a deal with the other one. What should I do? I can't really tolerate the fact that he will get acknowledged for the work which he doesn't know anything and didn't do anything about.
Is it possible that you misjudge why your advisor wants to see the other prof. on the paper? You say that the reason is that he was "declared as my second adviser on the project" ... but then you go on to explain that he actually was part of the discussions leading to the paper, so it does not, or at least not entirely, sound like a courtesy co-authorship to me.
Of course, you (and maybe even your advisor) do not value the input he had, but unilaterally throwing him off the paper for this reason is a dangerous road to go down. If he had any part in actually doing the research or writing the paper, I would at least talk to the guy first and ask him whether he thinks that he contributed enough to become an author.
However, prepare that there is a non-zero chance that the answer to this question will be "sure, I advised you regularly on the project since it's start, why wouldn't I be a co-author??" (and mean it!). Decide in advance how you will react to this. Note that, if the prof. feels this way, there is likely no way to remove him from the paper without him being annoyed or worse. Your task then becomes to decide whether you want to add him to the paper purely to keep relations intact (or not).
Have you simply talked to your supervisor about it? You have a valid point, and don't need to worry about upsetting the professor (he likely won't be) by leaving his name out of the list since he hasn't contributed anything towards the actual content of the paper. Your supervisor is more than likely just trying to do a 'fair' thing for the professor since he "helped out".
Anyways, the best thing to do would be to simply speak your opinion. If you have real evidence (or there is a mutual knowledge) of the lack of contribution, you'll be fine.