What did early Christians think about the gospels?

Why did God have Matthew write an account?