Is masturbating in the presence of another male, with absolutely no physical contact, a sin? And if it is, why? (Since there is no physical contact going on.)
It is wrong for two people, who are not husband and wife, to touch each other in a sexual way. Such is essentially what homosexuality is when done between people of the same gender and that is strongly condemned as a sin (I Corinthians 6:9-10).
Even if such touching was not taking place, we still have to consider that you and your friend are seeing each other sexually aroused -- not the accidental view of an erection, say in a shower, but a purposeful view where sexual activity is taking place.
The general rule since the fall of man is that a person doesn't expose his genitals to others. We make efforts to keep our privates private. Of course there will always be times when it can't be avoided, yet we should make efforts to minimize it. Being seen naked in front of others ought to trigger a sense of shame. "Your nakedness shall be uncovered, yes, your shame will be seen" (Isaiah 47:3).
Let me use the example of Ham (Genesis 9:20-27). Ham's father, Noah, sinned by making wine and getting drunk. Ham accidentally walked in on Noah while he laid naked in his tent. Rather than be embarrassed by the situation, Ham went to his brothers. We aren't told what he said, but it is likely he thought it was funny that their father was acting so poorly. I want you to particularly note Japheth and Shem's response: "But Shem and Japheth took a garment, laid it on both their shoulders, and went backward and covered the nakedness of their father. Their faces were turned away, and they did not see their father's nakedness" (Genesis 9:23). I'm sure that over the years there were many occasions when they might have seen their father without clothes. They could have just walked in and covered him up, but they were making a strong point. Their father, because of his drunkenness, was in an embarrassing state, and they refused to see their father lowered in their eyes. Thus they went out of their way to make sure they didn't see Noah uncovered.
The implication in this passage appears that Noah wasn't just unclothed, but also sexually aroused. There are other passages that also connect the term "nakedness" with sexual activity (Leviticus 18:6-19).
It is improper to expose your sexual activity before other people. It should be reserved for you and your wife alone.
While you might not find the idea of being naked in front of other men bothersome, you don't know the thoughts of others. Some might not care, but others might find it difficult to control their thoughts. Some might go along with what you do, not because they normally do the same, but because they don't want to be different. Paul talks about people compromising their personal sensibility and doing things they are not certain is right. In this case he is talking about eating meat that might have been sacrificed to an idol, but the principle is something we should be aware of: "Do not destroy the work of God for the sake of food. All things indeed are pure, but it is evil for the man who eats with offense. It is good neither to eat meat nor drink wine nor do anything by which your brother stumbles or is offended or is made weak. Do you have faith? Have it to yourself before God. Happy is he who does not condemn himself in what he approves. But he who doubts is condemned if he eats, because he does not eat from faith; for whatever is not from faith is sin" (Romans 14:20-23).
One of the complaints God had against ancient Israel was the fact that they lost their sense of shame. ""Were they ashamed when they had committed abomination? No! They were not at all ashamed; nor did they know how to blush. Therefore they shall fall among those who fall; at the time I punish them, they shall be cast down," says the LORD" (Jeremiah 6:15; see also Jeremiah 8:12). Therefore, whether being nude bothers you or not, act as one trying to keep a sense of what may be embarrassing to others.