Since this is basically an optimization problem, I would start with defining a suitable objective function that can be used to check which one of a number of solutions is best. To avoid transitivity issues, it's best to have a function which computes a numeric fitness value from a given solution.
In your problem, you have three factors that contribute to fitness:
- team size difference
- team strength difference
- "happiness" (how well each player's team preferences are met)
There are many different ways these can be combined into a single number. For example you could just sum up player strengths for each team, or you could penalize solutions in which one team has more of the weak players than the other one. Similarly for happiness: if individual player's happiness is computed by the number of matched preferences (possibly weighing negative preferences stronger than positive preferences) you could optimize for highest total happiness, highest "minimum happiness", lowest number of unhappy players etc.
To avoid getting completely implausible solutions, it's probably best to have some kind of nonlinearity such that if one aspect of a solution is particularly bad, the contribution of this aspect to the overall fitness is stronger.
One fitness aspect (team size) may be taken out of the objective function and baked into the algorithm, for example by only ever considering solutions with equal team sizes. Alternatively, you could give team size difference a higher weight than strength difference and happiness.
For this specific problem, there is most likely no specialized optimization algorithm, so you should choose a generic one, such as simulated annealing or some genetic algorithm. Off the top of my head, I don't see how you could define a combination/crossover operation for a genetic algorithm, so you would probably be limited to simple mutations and removal of weakest solutions from the population. This requires experimentation.