I'll never really understand why Yoshi would turn against Mario, just because Mario temporarily utilized a carnivorous dinosaur (who will attack Mario upon seeing him) to get through obstacles that even Yoshi wouldn't be able to handle.
And before anyone asks, Yoshi also eats fruits, making him an omnivore.