Morality, and by extension ethics, are a human construct to ensure social growth and cohesion. We are a pack animal, and as such thrive off joint constructive enterprise. However, notions of right/wrong, good/evil, legal/illegal are all societal and cultural creations stemming from the context of the civilization in question. There's no objective "need" or "duty" to abide by these rules, aside from the basic fact that it's very hard for a human being to survive purely on its own, thus we clan together and establish rules most of us agree upon to make sure we can survive more easily.
To obey morality stems out of self-interest: give each member a set of rules that they feel good abiding by, and you have a stable group that can thrive. To refuse to abide by them is a far more selfish notion as it implies a conscious neglect of the greater good of your group as seen by the majority, and unless undertaken by a smart individual, will be seen as nothing more than petty criminality. Of course, as societies grew bigger and bigger, and with the influx of a greater number of ideologies, there is now a fixed set of right and wrongs which have been set in stone, with a central tenant of the value of man and the human life. At least in our society.
The prisoner's dilemma in its basic context is almost purely mathematical: each prisoner has three possible outcomes: 1 year, 2 years or 3 years in jail. There is no way, mathematically, to tip these odds in any one's favour. It is all to do with the particular person, how well they know each other. This then establishes a probability for each outcome: it is then assumed that whichever prisoner knows the other one best will have the upper hand in knowing these probabilities, and his decision to act upon this information then stems from his own "moral compass". That is to say, pure self-interest: rat him out and aim for the 1 year sentence, disregarding the other person's well-being, but ONLY if you're sure that he doesn't rat you out. If you believe the probability of that being greater than him testifying against you as well. Etc etc for the other possibilities.
This gets us no closer to the problem at hand, it's merely a little thought test, as it all hinges on the particular beliefs of each individual, which have to be stripped down to the bare bones to be computable, otherwise you just end up with a mess of data.