I don't think people understand that the teaching that "attachments are not the problem but obsession and fear that it could lead to are" is a teaching from the universe of SW and not from the jedi order.
Because the amount of times I see people making mental gymnastics to explain that loving wasn't wrong actually in the jedi order! And the character just misinterpreted it, and actually everything could have been fine if Anakin or Sidious hadn't done this thing-
Loving itself and feeling this emotion wasn't wrong, that is right. But following this emotion was not the course of action any jedi was supposed to take.
That doesn't mean it was expected of characters to hate anyone or never be in love, it means it was expected that they ended up feeling this emotion one moment or another eventually but that then they should let go of it. That they should focus on the light side of the Force.
Jedi were meant to let go of platonic love such as that of a family, that's why they were taken so young and being more older could be considered a problem. They were expected to let go of romantic love, as we have several different stories of jedi having romantic feelings for others and letting go of these relationships to focus on the order.
There wasn't a lesson about healthy attachment or how to not let fear for your loved ones or jealousy cloud your judgment, because it was expected to let go of the relationship as a whole.
And that isn't wrong, there are real life religions who expect this course of action. But that doesn't mean it was the best course of action or rule for the jedi to decide.
If just having relationship were actually fine and everyone just misinterpreted it, we wouldn't have jedi having secret relationships (Anakin, Etain) or jedi ending relationships/staying away from them because of it (Obi-Wan, Anakin) or others getting into relationships after leaving the order (Quinlan, Eeth Koth) or even jedi secretly pining after other jedi and chosing to let go of it (Qui-Gon and Tahl, Obi-Wan and Siri).
I'm not saying that the order is evil for it or that I'm anti-jedi but that their choices and rules regarding attachment are not a match to the teachings of the story in overall.
That's why Luke in legends actually goes on to have kids and family since he recognizes this as a mistake of the order, 'cause neither he or Leia were raised to follow these rules.
That's why stories of relationships with jedi are showed as tragedies. That's why most of the ones that we do see happen end in this way. Because jedi are not taught that attachments are bad but that they should always let go of it, instead of learning to be able to, in order to keep these attachments healthy.