Yes, but attachment can actually be a problem. I'm going to leave out Episode III and just point out that fear of losing something or someone leads people to doing all kinds of bad things in the real world.
The Jedi are supposed to be based on a Buddhist worldview where metta (loving-kindness, which isn't detached in the way Jedi in later media are often portrayed) is encouraged. What is discouraged is desire, which could lead to grasping or other problems, which lead to suffering. I don't think this is universally true, but it's not complete bullshit. It's based on something. (Both the writer and director of ESB, which elaborates on the Force, had a strong interest in this stuff.)
Personally, I came to the conclusion that desire is actually important. Desire is what motivates most people, including me. If one cannot avoid the bad, I think it is still worthwhile to pursue it. It doesn't seem foolish to me to take the good with the bad. As long as the bad isn't too bad and you don't wind up slaying younglings, it seems like something manageable.
The Jedi should be a mix between samurai and Buddhist monks, really. Maybe you've already cottoned on to this.
I think a lot of these philosophies try to boil things down too far, so then they become simplistic and untenable -- just like the popular representation of the Jedi as having no attachments. But if you have no attachments, then what do you care about? Will you actually help people? Does anyone matter to you? Are there things that can be learned
because (and not in spite) of attachment? What motivates you? Fearing losing control, one avoids caring altogether.
It reminds me of Donaldson's "Land" and the Oath of Peace.
“Do not hurt where holding is enough;
Do not wound where hurting is enough;
Do not maim where wounding is enough;
and kill not where maiming is enough;
The greatest warrior is he who does not need to kill”
This isn't a bad thing, in many ways it is admirable.
However, there is a moment of catharsis for the High Lord late in the first trilogy where he realizes the Oath of Peace is why they cannot defeat evil, in a sense. Because Power is Power, and Power is a two-edged sword. It will always be able to harm
and heal. Because of the Oath, others of them with power (on the side of good) basically hamstrung themselves, fearing to use power -- but there are some evils that must be expunged and you must pour everything you have into that battle in order to defeat evil rather than automatically restraining yourself. It's why they were losing so often.
It's a little like what we were talking about in the political thread about "going high vs going low." Don't debase yourself but sometimes these battles have to be fought without quarter and effectively, with everything one can give.
the Jedi are sometimes written as if they fear caring emotionally so much (fearing it leads into darkness) that they expunge compassion. Nothing in life is that simple, and I think to fight for things that you think matter, you have to be willing to take risks and feel love and let it motivate you. Humans have positive and dark emotions, it's just how we are. Instead of focusing on the emotion, focus on what you are doing with them.