On the MyGames page one of the sorting options is Opponent Name, but this can't give you what you want. Not all, in fact not even most, user names are in a form which identifies a player's surname. In my own case it's not even my real name. Others give surname only, first name only, initials and surname, or some combination of letters and/or numbers.
Since the surname is so often not identifiable, it will not be available for sorting purposes.
Perhaps you can provide a little more information.
Which directory do you want to sort?
Where have you seen a directory of players that includes their last name?
Members are only identified here by username.
As Kewpie has pointed out, the use of real names is not done very often. If you are looking for a particular person that you have played before, then you should be able to find them in one of the folders found on the 'my games' page, which can all be sorted by "opponent name".
Also, if you go to the "players" link at the top of the page and use 'player search' on the left side of the page, you can enter the first few characters of the username into the search string and then click search. That will help to narrow it down a little for you. Include more letters and characters to narrow the field of results.