Mark the bats with painted symbols
The idea of trademarks and brands are almost as old as humanity. A little paint and a symbol registered with race officials and you know exactly whose bat won.
Place your bets!
Betting on bats would be no different than betting on any other sport, but let's stick to horse and/or dog racing. Bets would be on first, second, and third (win, place, and show).
Fly! you little stinker! Fly!
You tagged your question "magic." Cool. Motivation is easy with magic. Put something pungently tasty at the end of the race and then magically cause your bats to feel desperate hunger. They'll fly like a bat out of... well... you get my point.
None of which is your actual problem
How do you determine who won? Bats are small, fast, and (thanks to echolocation) notoriously difficult to catch. And if two bats are flying closely together, they're hard to see as two bats (much less more). Here are some ideas:
Have a magical "photo finish." In this case, it's not paint used to mark the bats, it's a magical symbol, unique to every bat. A magical "ward" is placed across the finish line that tells the magician which bat crossed it (and hope he's sensitive enough to know which came first between two flying neck-and-neck).
Have a rotating set of nets at the end designed like lobster cages or deep butterfly nets. This helps to avoid the echolocation response to avoid the nets, but the turning net (think "pinwheel") could capture bats as they come in (other than the neck-and-neck bats).
After the "finish line" have the bat owners at their own tables (somewhat separated, like by 10' or more) and rather than using one pungent and tasty food, use a unique one for each bat, magically driven mad to get to that fabulous treat as fast as possible! Each table is overseen by a judge/referee with a flag that must be raised once the bat is back in its cage.