How can states amend their constitutions to ban same-sex marriage when Article IV of the US Constitution states that public acts such as marriages from one state are legal in all states?

They cannot. Effective June 26, 2015, no US state or territory may ban same-sex marriage, whether by constitutional amendment or statute.

== == The "full faith and credit" clause of Article IV of the US constitution forces states to recognize the public acts and records of other states. However, there is a phrase in Article IV that allows congress to regulate this. In 1996 congress exercised this power by passing the Defense of Marriage Act, which allows states to ignore gay marriages. The constitutionality of DOMA has yet to be tested in federal courts. A ruling against DOMA could potentially require all 50 states to recognize gay marriages from Massachusetts, Connecticut, or California regardless of their own of laws or constitutions against them.