In baseball, pitchers are expected to pitch - and that's all. If you're a starting pitcher, you are lucky if you get to appear in 30 games during the season. Because of that, teams either don't expect them to hit (National League) or flat out don't let pitchers hit (American League). For the same reason, pitchers are usually told to not field any hit balls that another fielder can handle - they just don't get that much game experience.
I don't know what went through the mind of Houston Astros pitcher Collin McHugh here. It certainly wasn't the rule about not fielding the ball. Perhaps it was a fleeting thought about wishing he could get a chance to hit a ball that way. In any event, McHugh was forced to do something when the Oakland A's hitter scorched a pitch at him. Watch the move and wonder if the guy has a future in a movie series featuring Keanu Reeves.