What I had read is that Ford did it spontaneously on a lark, and they liked it, so they decided to keep it. They thought it was better than what they had written in the original script.
It was.
The film critics from Salon and NYT went to see Broke Back Mountain together and just loved the film.