God is appealed to as the ultimate authority for the establishment of truth and logic, right and wrong, etc. See also GoodnessOfGod . Materialist position Materialism is as broad a concept as Religion. One can ask for a justification of objective scientific materialism but that's a very different thing.
Logic is a system of consequence.
Marvelling at the fact that logic models mathematical thought is exactly like marvelling at the fact that skyscrapers manage to stand for decades. They were built for that purpose. In at least one philosophy, reality comes about by definition. This is not at all strange since one is forced to define the term 'reality' anyways. Reality is that least complex mathematical theory which has everything that mentally exists as consequences.