Science and religion are compatible because Science is a search for knowledge and Religion is a search for a way for men to connect with God. It's kind of amazing how far we have come since the Bible was written. We have discovered many things such as how to fight and cure diseases that were once fatal. We have walked on the Moon and discovered atoms and so much more. The question, "What is right and what is wrong?" is a genuinely difficult question that science certainly cannot answer. Given a moral premise or a priori moral belief, the important and rigorous discipline of secular moral philosophy can pursue scientific or logical modes of reasoning to point up hidden implications of such beliefs, and hidden inconsistencies between them. But the absolute moral premises themselves must come from elsewhere, presumably from unargued conviction. Or, it might be hoped, from religion - meaning some combination of authority, revelation, tradition, and scripture.
Unfortunately, the hope that religion might provide a bedrock, from which our otherwise sand-based morals can be derived, is a forlorn one. In practice, no civilized person uses Scripture as ultimate authority for moral reasoning. Instead, we pick and choose the nice bits of Scripture (like the Sermon on the Mount) and blithely ignore the nasty bits (like the obligation to stone adulteresses, execute apostates, and punish the grandchildren of offenders). The God of the Old Testament himself, with his pitilessly vengeful jealousy, his racism, sexism, and terrifying bloodlust, will not be adopted as a literal role model by anybody you or I would wish to know. Yes, of course it is unfair to judge the customs of an earlier era by the enlightened standards of our own. But that is precisely my point! Evidently, we have some alternative source of ultimate moral conviction that overrides Scripture when it suits us.
That alternative source seems to be some kind of liberal consensus of decency and natural justice that changes over historical time, frequently under the influence of secular reformists. Admittedly, that doesn't sound like bedrock. But in practice we, including the religious among us, give it higher priority than Scripture. In practice we more or less ignore Scripture, quoting it when it supports our liberal consensus, quietly forgetting it when it doesn't. And wherever that liberal consensus comes from, it is available to all of us, whether we are religious or not.
Similarly, great religious teachers like Jesus or Gautama Buddha may inspire us, by their good example, to adopt their personal moral convictions. But again we pick and choose among religious leaders, avoiding the bad examples of Jim Jones or Charles Manson, and we may choose good secular role models such as Jawaharlal Nehru or Nelson Mandela. Traditions too, however anciently followed, may be good or bad, and we use our secular judgment of decency and natural justice to decide which ones to follow, which to give up.