The Buddha taught rebirth because it is something real that is related to the arising of suffering; namely, the re-arising of the delusion of "self" as a result of the emotions created by kamma (actions). Whenever the idea of "I" or "mine" arises as a result of an action, this is "rebirth".
Discerning an absence of rebirth in the mind is necessary to understand emptiness. Also, rebirth (kamma & results) is one example of causality.
A Buddhist doctrinesdoctrine that make sense without rebirth is the Three Characteristics. Seeing the Three Characteristics is unrelated to rebirth.
Knowing Nirvana is also unrelated to rebirth although, similar to Emptiness, knowing Nirvana coincides with knowing an absence of rebirth in the mind.
As for a rebirth as an "afterlife", this is an unknowable unproveable primitive superstition. Any claims there is a "Truth of Afterlife Rebirth" is obviously a lie or falsehood because there is no evidence for this belief. It is only a "belief" but not a "truth".