People already provided some good answers, but I'd like to add my perspective to it.
1. Team Score:
I really don't see why people in a cooperative game should get individual scores. I'd suggest giving them a team score. You can add individual scores, as well, for "personal performance identification reasons". Just give it a less prominent position in the UI or scoreboard. You may also add some rewards for the maximum team score. Skins, or even achievements, will do. They will endorse cooperative play, and the better player will have more incentive to help the worse player.
As Akaltar already posted, give them different objectives. A cooperative game should be a-symmetrical in nature, or it's not worth cooperating with each other. If both players can do everything, one will steamroll ahead, while the other falls back.
3. Severely Punish Competition:
Just make it ridiculously hard to progress alone, and reward cooperative play in a difficulty sense. This is really genre dependent. Let's say it's an RPG. Give the "Tank" limited or no ways to heal, so they are dependant on the "Healer" or "DPS".
These ideas are, of course, very hard to get right. Going too far with them may be negatively perceived by the players. If one player is really good, and other really bad, it's just frustrating to the better player. You could help this a little by giving both players an individual difficulty setting. This way, people who really want to play together but are of different skill levels can still do so, and the high score hunters get rated off their lowest difficulty setting (or something of that like).