Is it possible for two friends (or two people using the same internet connection) to be matched up against each other in a ranked or unranked game?
Blizzard has not given an insight in the matchmaking system so far. But after searching around the forums of Starcraft 2, it seems like it's based of a matchmaking ranking (MMR), which is awarded for playing ranked games. Neither is the MMR system further explained. This ranking is also considered for unranked games.
This means: either you and your girlfriend don't have the same ranking or you are just unlucky and have always been matched with other players of the same ranking as you two.
If you're playing on a large server, it's likely that there are too many people playing for the chance of being matched against your girlfriend to be significant. I wouldn't be surprised if there were also restrictions in place to prevent friends from fixing ranked matches against each other, such as prioritizing having a new opponent each game, but Blizzard would stand to gain very little from explaining the matchmaking system when there are plenty of people who want to exploit it.
If you want to play against a specific person, that's exactly what custom games are for.