Most neighborhoods in SF have very little crime and homeless. Look at the Sunset and Richmond districts, Seacliff, Presidio Heights, Marina and Pac Heights (some of these might/will be prohibitively expensive because they're extremely nice), Forest Hill, Twin Peaks, Diamond Heights, Glen Park, Noe Valley, Bernal Heights, Parkside, Sunnyside and Portola if you don't mind being a little further south.
Basically just avoid SoMA, Civic Center, Financial District, Tenderloin, and any immediate surrounding areas. I also avoid the Mission but some people like it.