Single Pregnancy

Is it fair if the baby's father wants nothing to do with me throughout the pregnancy , but is willing to do everything he can for it when it's born ? Does it deserve his last name ?