I think Ingo was stupid for letting himself be used by Ganondorf in the first place. Anything else he did pales in comparison to the foolishness of betraying a kind-but-lazy master for an unforgiving one who would kill you in a heartbeat.
Aside from that, I don't think his actions were terribly stupid... I mean, he might not have noticed which horse you had taken until after you won the race. And maybe he just enjoys races. As far as locking Link in the ranch, okay, that wasn't the smartest move... but remember, in the original (unreleased) version of that scene, Ingo also sets fire to the ranch, not giving Link much time to escape. Which isn't quite as stupid.
I honestly think it would have made more sense for Ingo to try and kill Link somehow, rather than just lock him up in an open field on a horse. Besides, how did he plan to get Epona out of there for Ganondorf? Why didn't he just demand that Link give up Epona? Why didn't he just offer rupees in exchange for the horse, or offer you another one, explaining that he already had a buyer for that horse? And then maybe lock you up in frustration once you refused, and you escape THEN. It would have made more sense if he had only planned to keep Link until he gave up Epona.