I've only walked out of one movie in the opening 15 minutes (the 1990s The Getaway) but I have walked out of a movie (and the theater altogether) several times (Masked and Anonymous, Dancing In The Dark, and Breaking the Waves among them). Some films just don't know when to end.
He could go to the manager, get his refund, and then get a ticket for the movie he wants to see. By not doing so, he has shifted the ticket money away from the studio who's movie he watched, and instead left it with the studio that distributed the film that he did not watch.
There are actually some people who will boycott a film, studio, or director and pay for a ticket (say to a small independent film) and then see only one movie (George Lucas' Star Wars VIII). They rationalize it that George and 20th Century Fox will make more than enough (that does not justify this act).
It is all book keeping. The theater owner got ticket money and he is reporting to the studios how the money was paid to him (someone bought a ticket for screen A even if he walked into screen B instead).
Since the theaters make no money on the tickets, is it "theft" from the studios when the theater gives away free tickets to screenings? Passes may be prohibited for some screenings but there is never a ban on employees (and their friends) signing into a movie. The studio doesn't see a dime.