A US federal judge has backed Whole Foods Market's plan to buy rival retailer Wild Oats Markets after rejecting government claims that the deal would stifle competition.