I don't understand why this isn't everyone's policy for open-source contributions.
You know how you sign those end-user *license* agreements, which do not give you ownership in the code of those applications?
That's the same principle at work here. You are licensing certain rights in your work to another entity. Generally, the license is giving the right to, inter alia, reproduce and distribute your code in perpetuity.