It costs the studio money in some regards - some people who would have paid money to see it have now downloaded it and will not go see it. There are others who have seen a downloaded version but will pay to see it in theaters, and those who have only seen trailers and are waiting to see it in the theater.
In a way any publicity is good publicity, however you have to wonder what the true intent of those who leaked this onto the web really were. I'm fairly certain there is no concrete right or wrong answer here - I know plenty of fanboys who won't see a downloaded version, and know of many others who will see a movie at whatever cost.
Another question to ponder about the Wolverine movie is will it still perform once Star Trek hits?