In 1967, the United States joined the United Kingdom and the Soviet Union in signing the Treaty on Principles Governing the Activities of States in the Exploration and Use of Outer Space, Including the Moon and Other Celestial Bodies. The agreement, more casually known as the "Outer Space Treaty," remains the closest thing the world has to "space law" -- and it stipulates, among other things, that as countries explore space they should avoid contaminating it with the microbial life of Earth. So while we may talk, with a mixture of fantasy and inevitability, about the colonization of other planets by humans, NASA takes great pains to avoid colonizing those bodies with life of a different variety: bacteria and spores that might hitchhike their way through the galaxy via American spacecraft.
But keeping space free of earthly critters is a difficult task. In fact, it's an effectively impossible one. Curiosity, for example, was not completely sterile at its launch; rather, the rover was built to ensure that it would "carry a total of no more than 300,000 bacterial spores on any surface from which the spores could get into the Martian environment."