The Question and Answer section for Rudyard Kipling: Poems is a great resource to ask questions, find answers, and discuss the novel.
The lines don't specifically mention betting on horses............ in fact, they only mention winnings, which of course might be gambling, but they might also be successes.
From the poem:
We can pull and haul and push and lift and drive,
We can print and plough and weave and heat and light,
We can run and jump and swim and fly and dive,
We can see and hear and count and read and write!