Hot and Neutral on Same Circuit Breaker
You'll need a 20A GFCI breaker for this

What you are looking at there is a 240V circuit on a two-pole breaker; both the black and white wires are hots, but from opposite legs of your service (one pulls one way, the other pulls the other way), which is why connecting them both to the LINE HOT on the GFCI receptacle tripped the breaker (as it should have, to stop the game of electrical tug-of-war you inadvertently created).

As a result, you can't use a GFCI receptacle on this circuit at all, as 240V GFCI receptacles simply are not made; instead, you need to use the correct GFCI circuit breaker for your panel to provide protection to a regular (non-GFCI) 240V receptacle of the correct configuration (and a Sharpie, black electrical tape, or the likes to remark that white wire in your picture as a hot wire).

And by the way, the correct receptacle for your application is a NEMA 6-20T; if the receptacle there already wasn't a NEMA 6, it'll need to be replaced with one, lest you leave a 240V boobytrap for the next poor bloke who has to service this circuit!