No Signature
Let's look at a version where the responder does NOT sign message 2.
(1) Tom → Frans : gx
(2) Tom ← Frans : gy, EK(gx, gy)
(3) Tom → Frans : EK(SA(gx, gy))
What if there is someone in the middle?
(1) Tom → gx → DIRNSA → gd → Frans
(2) Tom ← gd, EK(gx, gd) ← DIRNSA ← gy, EK(gd, gy) ← Frans
Well shucks. Now I can't tell that DIRNSA just performed a MITM attack and I'm talking to him instead of (or addition to) you. If you just signed the message we wouldn't have had this problem (or DIRNSA would have had to work harder) but now the attack is stupidly trivial.
Notice the values ($g^x, g^y, g^d$) are ephemeral, not long term secrets, which allows this replacement to take place. There is no way to verify $g^d$ isn't the correct public value.
Signing a Challenge
(1) Tom → (gx,Challenge_1) → DIRNSA → (gd,Challenge_1) → Frans
(2) Tom ← gd, EK(gx, gd, Sig_Frans(Challenge_1)) ← DIRNSA ← gy, EK(gd, gy, Sig_Frans(Challenge_1)) ← Frans
It is easy to see that the existence of a signed challenge shows liveness but does nothing to assure us the channel is secure.
Signing $(g^x,g^y)$ instead of $(g^y, g^x)$
This is very much the same thing conceptually. So long as both sides agree on the order the signature provides the needed security. What you can't have is one side signing a message in one order and the other side trying to re-construct a message and verify a signature with the other order.
Signing One's own Ephemerial Public key (Bob Signing $g^y$)
This does not give Alice any proof of liveness and can result in replay attacks.