Surrogacy allows a same sex male couple to have a uterus for (well, one of their) biological children to grow and develop it. They would also need an egg donor, which may or may not be the same person who is acting as the surrogate. It is ethical because both the biological father, the surrogate, and the egg donor are agreeing to their respective roles in bringing this child into the world. Study after study has shown that LGBTQ+ parents and heterosexual parents raise children just as well.
Many same sex female couples simply need a sperm donor, getting the needed egg and uterus from one or both of the women in the couple. Therefore a surrogate really isn't needed.
Surrogates can be used by heterosexual couples as well. Some women due to various medical problems are unable to carry their biological child. They could use an egg (from the woman) and a sperm (from the man) and implant the fertilized egg in a surrogate so the couple would be able to have a biological child.
Really all surrogacy is is one woman who cares enough about a particular couple (whether they are same sex or a heterosexual couple) to allow their child to develop in their uterus through medical science. This process allows people who otherwise would have been unable to have a biological child have the biological child they want so badly.