She wasn't a prostitute, she was his servant, and he had a child by her because Sarah urged it. They were banished because Agar started looking her nose down at Sarah due to her having the child, so Sarah became jealous and asked Abraham to kick her and Ishmael out; God told him to just say okay, even though Abraham felt it was wrong; God then looked out for Agar and Ishmael.