It might be their third most popular country but that doesn’t necessarily mean it’s profitable. Brazil isn’t exactly known for spending a lot on things like Twitter Blue or ads, especially per capita.
I have a theory they looked at the numbers and realized that shedding the load would save more money than they would gain by staying. But then again that might be giving Elon too much credit.