What is the scientific purpose of having two genders in all living beings when reproduction could be reached asexually?

What is the scientific purpose of having two genders in all living beings when reproduction could be reached asexually?