Be5 sets up Bd6+ which is necessary to set up the mate.
I didn't understand the first move
No, it's a posional move that allows the bishop to reach an important square. Without this move first, you cannot fulfill the requirements of the puzzle which is to mate in three. Black moves the rook to h8 to try to create an escape square on g8 because any other move allows Bd6+ followed by Qe7# rather than Qxe6#. You must, however, move Be5 first. A waiting move, by definition, is a move that does not improve your position, but no matter what your opponent plays, it will weaken his position. They are relatively rare. In this case, Be5 clearly improves White's position.
http://www.ideachess.com/chess_tactics_puzzles/checkmate_n/45219
Why move the bishop ? What is the logic behind that?