Equal Protection means that if the government offers something, then people, all people, must be treated equally in access to it unless the state can show how a legitimate state interest is furthered by the restriction.
For example, driver's licenses are offered by the state in order for people to drive on the road. They come with restrictions on entry and even on use. You must be 16 (in pretty much every state) to get a driver's license. This is based on many factors that the state can show further a legitimate state interest in keeping the roads safe while allowing the highest percent of those citizens who may need to be able to drive that ability. The state could not make a random age restriction, such as no one between the ages of 42 and 47 can have a license without being able to show some legitimate state interest is being furthered (once the law is challenged) in that restriction. They cannot make a restriction on driver's licenses that said people with red hair cannot drive at night without showing how this restriction furthers a state interest. They can make restrictions on people who have issues with their eyesight because they can show that being able to see is vital to operating a car properly (at least for now) and restricting those who can't see to certain limitations furthers a legitimate state interest in public safety on the roads.
The same applies to marriage licenses. The state must show that a legitimate state interest (at least) is being furthered by any restriction (once challenged) that they place on marriage licenses. They could not show any such interest being furthered by race restrictions, restrictions based on a person being behind on their child support, or restrictions based on a person being an inmate with possibility of release. There have not been any legitimate state interests shown to be furthered by restrictions based on sex, but ultimately it will come down to SCOTUS decisions which are likely to eventually rule to strike these restrictions down even in those states that have them. The state has been able to show legitimate state interests in not allowing people to have legally recognized multiple spouses and to not be able to marry close relations. (Whether these continue to hold up in the future, who knows, but it is likely since the arguments revolve around legitimate interests in offspring and minimizing undue influence and the fact that the marriage laws functions around two people only being considered as spouses to each other.) Age restrictions are likely to stand up, if challenged, at least to 18, if not higher as state interests based on when the state views a person is legally competent enough to enter into a contract and take on those legal responsibilities. Plus, lower ages present an issue with competency within consenting to sex, which is recognized as a component of most marriages.