What is this?

It's called a "Turing test" after the English computer scientist Alan Turing who originated the test in 1950.

Why do we do this?

Simply put, because if we don't put some form of turing test in our web forms, we get inundated with form spam that is generated by automated tools run by spammers and hackers on the internet.

Why would they do that?

The sad thing is, it's indicative that they feel so poorly about themselves that they believe legitimate endeavors are not sufficient to take care of themselves. They believe they have to resort to abusive behavior to get what they need. How sad!