I maintain that an atheist can have morals - absolutely. For me, the expert in this field was the philosopher David Hume (1711-1776). But his deliberations didn't meet with much acclaim at the time. Many other thinkers have struggled with your question. They failed to answer it by arguments based on pure reason. Like the great Kant, they had to postulate some "a priori's".
In modern times, experimental psychologists have entered the fray, devising highly simplified experiments e.g. on the famous "prisoner's dilemma" and its variants. Others have done computer simulations on "populations", which included some "antisocial" individuals, besides the law-abiding (moral?) majority. It turned out that "policing" by some members of the majority improved the fate of the group. But this almost amounts to "begging the question" - a question which, in my opinion, is still unanswered.