I have two that bit their tails, and they lived in a 5 gallon at the time.
Actually, the size the betta is in in the pic doesnt look that bad, compared to the other stores.
I also thought about the male, but it seemed odd, as it was overnight, and wouldnt the betta be in with him. But then I think maybe they were put together durung a water change, or one jumped into his cup during a water change, etc.