Some people don't have time to be searching all over the place. You may have just missed the owner on your walks. I have a friend who's dog was gone for 3 weeks before he actually found him. He did what he could to find the dog. But, what does a person do? Drive around aimlessly? NO, they call local clinics, the local animal shelters, they place ads (if they can afford it) in local papers. Just because he is un-neutered does not mean he is unloved! I agree with neutering 110% but, I have also learned not to judge those who make an educated decision not to.
I do now know the law where you live. Where I live Only the Humane Society has the legal right to transfer ownership of a domesticated animal without owner consent. But, if you can prove you have made "every effort" to find the legal owner then, after 30days, the animal is considered yours.
It is find if your friend fosters him, even with the intent of keeping him. But IMO you have a moral obligation to exhaust every avenue of finding the legal owner before your friend decides this dog is theirs.