You need to go into System Preferences → Security & Privacy and change “Allow apps downloaded from:” to “Anywhere”.