Interesting question. I'd suggest that you create an index which defined as:
Index = (Total wins) - Weight * (total losses).
With the example you gave, if you set Weight to 4 then the result would be
#1 (Index = 36) 40 wins, 1 loss
#2 (Index = 10) 10 wins, 0 losses
#3 (Index = 1) 1 win, 0 losses
#4 (Index = 0) 40 wins, 10 losses
#5 (Index = -39) 21 wins, 15 losses
so it would give you the order that you want. But you can play around with the weight to get the type of ordering that you desire.