I think a 2.5 gallon tank is too small to be divided with a see-through divider. I actually think a 2.5 gallon tank is too small for a single betta. I'm on the conservative side of this issue, but I think that these animals need as much space as possible.
Having them able to see each other is possibly, and probably, stressful for them. They want to protect their territory as males, and are solitary fish, I have read. So, for some reason people sell divided small tanks, but I don't think they should be used.