When I was younger, I had a bright idea to solve this problem: simply put a small nylon snap at the top of each sock. Then, before putting them in the washer, snap each pair together so each sock stays with its mate. Dry them likewise. Presto—your socks are already matched!
Then, years later, I found that somebody else invented them independently (see this article in the Sarasota Herald-Tribune from 1977). I guess the socks (called “Perma-snaps”; my own name was “Snap-Eze”) never caught on. And I still have a plastic bag full of unmatched socks, hoping some day that I’ll find their mates.
Another solution I thought of was to throw in a single spare sock to propitiate the Sock-Eating God each time you do your laundry.