I guess the only rationale would be they were planning to go for 2 later on if they recovered the onside kick and scored a TD. If you know that is your plan, the most logical course-of-action is go for 2 on the first TD. If you make it, great, you win with a another TD and extra-point. If you miss it, you still have the opportunity to make up for it on your second TD by going for 2 again.
If you kick on the first TD, and then you go for 2 and miss on the 2nd TD, you can't reverse time and go back and make it up.
Some argue you should not go for 2 until you absolutely need it; Jon Miller got worked up about this after the 2017 Purdue loss when Iowa went for 2 after they scored a TD with 1:04 left to make it 15-24. He argued that it was moronic to go for 2, because as soon as you miss it, the game is over. But the reality is, the game is over whether you miss your 2pt conversion after the 1st needed TD or the 2nd needed TD. But if you miss it early, there is still a chance to try to adjust strategy to overcome the miss. If you miss late, there is nothing you can do.