He did it because he is a juvenile, hateful, contemptuous, egotistical person. That's why.
Obama is a self-destructive guy. Cocaine, marrying a hateful woman, attending a hateful church, hanging around with hateful Ayers. This is just another self-destructive notch in his belt.