Why is it better to capture the f pawn? Yesterday I reached this position:

[fen "rnbqk1nr/ppp3bp/3pp1p1/5p2/2PPP3/2N2N2/PP3PPP/R1BQKB1R w - - 0 1"]

1. Bg5 (1. exf5)


White to play, I played Bg5.
Lichess told me in the analysis that was inaccurate although latter on, it pointed this move out as one of the best moves.
At first, he recommends me to move exf5 in the 6th move and in the next moves for White.
I would like to know why it is convenient to make this capture since I do not see any benefits in capturing this pawn at any time.
The link of the game is: https://lichess.org/PyqeZZnQ/white#10
If the black captures in return (there's not much choice for black), you either get an open vertical e or a nasty attack on the black King by Qh5+ and so on.

But don't worry. Bg5 is also not so bad move =)