I've read in multiple, multiple articles and posts that five gallons is a very good size to start off with for a betta. As 2.5 g is half that size, I would say it is too small for two fish to live in. If possible, I would suggest getting a larger tank. For the best quality of life for your cory, how about buying two companions for him? I read groups of three is the minimum number that cories should live in. I hope this helps.

It is a common misconception that "cleaner fish" are helpful in all aquariums. In this situation, all the cory is doing there is making the tank messier, really. In a community tank you're feeding a lot of fish, and inevitably some uneaten food falls to the gravel--the cory simply eats this excess food.

In a betta tank, you shouldn't really be feeding this way--pellets allow you to easily control the amount you put in the tank so little to none of it goes uneaten. Having to add extra food for the cory is really just making your tank messier, defeating the purpose of having a "cleaner fish." You should also be siphoning your gravel to remove any uneaten food or waste--trust me, a siphon is much more effective than any catfish.

I also don't believe it's humane to keep schooling fish in such low numbers. They're naturally social fish, and without others of their own kind they can't express their natural behaviors--they often become stressed and do not live as long. I highly suggest moving this cory to your other tank and keeping the betta by himself. Keeping the cory alone in that little tank would be a bit selfish.