Their natural state could be a single-headed very large snake that normally only lays one egg per clutch that it coils around and protects until it hatches, but sometimes a slightly larger than usual egg is produced. So far everything seems normal, but an oddity in the amphisbaena's genetic makeup has made it so that any ovum it produces would partly merge with another if it were present in the rare case that more than one ovum is released, almost as if each ovum acts slightly like a sperm cell and wants to fertilize the other one, but they'd never fully merge and would have a single egg shell develop around both of them. The developing partly merged fertilized cells could then(with some degree of variance as to the angle) produce a single body that consists of two snakes each conjoined at the tail, producing what effectively looks like a snake with another snake's head at its tail.
They'd each have their own set of digestive tracts and various organs and separate waste disposal shutes and everything so nothing would clash and make staying alive a medical impossibility, but with each being an independant entity(except for being conjoined at the tail) they may fight with regards to where they want to go and they might even fight or bite each other if current real two-head snakes are anything to go by. Some amount of intelligence or learning to live with each other or having one dominate the other would go some ways to making moving around less of a tug of war.
A further oddity about this would be that there's a very real chance that one snake would be male while the other is female, producing a faux hermaphrodite and allowing the amphisbaena to impregnate 'itself', but whether or not such a creature would actually do that I'm not certain.