This is Luke's lowest moment in the movie, after Rey has discovered the truth that he once considered bumping off his nephew. Why dress up for such an occasion? Luke tells Yoda, "I'm ending all of this." Which doesn't sound like he's only going to torch a tree. It sounds downright suicidal.
If Luke put on his robes as part of some kind of ceremonial goodbye, that could also explain why he was wearing them earlier, and why he was lurking at the edge of a giant cliff. Meaning that at the end of The Force Awakens, Rey inadvertently saved Luke's life.
It's not such a stretch. Luke tells Rey that he came to the island "to die," and Mark Hamill once referred to this version of Luke as "a suicidal, cranky old man." When Luke actually dies, he is, again, wearing his robes.
The official reason for all this, found in the movie's official novelization, is that the robes are the "ceremonial attire" for burning the magic tree down -- which doesn't really make sense. It seems more like the author concocted a sanitized version of the film's true subtext so that it didn't read like a Star Wars-y version of The Bell Jar. (The Bell Jar-Jar?)