Can you be friends with your friend's enemy?

Bre

I've done it. There were no problems and both sides were cool with me being friends with the other girl. Why is this so frowned upon?