There is a change in punctuation:
But if anyone thinks he is behaving improperly by remaining unmarried, and if he is past the bloom of youth, then this is what should take place: Let him do what he wants; he does not sin. Let them marry.
But if anyone thinks he is behaving improperly toward his virginity, if that is past the bloom of youth, and this is the way it should take place, let him do what he wants; he does not sin. Let them marry.
The first is a command "do this when he does that", the second means "well, if what I just said happens in that order he's free to do what he wants".
Also behaving improperly towards your virginity means sex of some sort, flirting, that kind of stuff. Behaving improperly BY remaining unmarried puts the narrative on the act of being unmarried, not the act of behaving improperly towards your virginity.