Sacramento and Stockton rank among the hardest and most expensive U.S. cities to find a starter home, a study showed.