In that matrix, total time served if they remain loyal is 2 months (one month for each of them). If one of them betrays the other, total time served is 1 year (for one of them while the other goes free). If they both betray, total time served is 6 months (3 for each of them). So it seems to me that if they both remain silent, that is the best aggregate outcome. However, it isn't always the case that someone will automatically be screwed no matter what. Sometimes if they both remain loyal, they can't be charged with anything. The reason there is temptation in a case like that is because if the other guy breaks, then you are screwed, not because loyalty isn't the overall best outcome but because individual outcomes vary with each possible set of choices in the matrix and there is risk in not knowing what the other person will do.
Maybe you don't care about "overall best outcome". Maybe you only care what happens to you, in which case I assume you would betray me. But in the face of rules that are going to screw the people no matter what, closing ranks causes the least overall harm -- assuming you have sufficient trust to pull that off in the absence of communication. (EDIT: For example, if you are both members of an organized crime syndicate or a resistance movement, the organization suffers the least overall loss/cost if it gives very strict orders that no one talks -- assuming the two people are of equal value to the organization. Even if you are not part of a larger organization, betrayal costs not only time served but trust of the person you betrayed. Depending upon the situation, one month in jail may be less of a loss than losing this person's trust.)