An important clarification: You can have upto 15 winning bids at any point. So if you place a 4th winning bid, the lowest bid isn't removed or anything. You can place as many bids as you wish as long as you bid on only 15 players total, and your winning bids at any point don't sum up to more than 6,000 points.
Once auction is over, then the 3 highest winning bids that a General have form their team. The algorithm is as follows: we start from the highest bid, and start assigning people to teams. Once a general has 3 players assigned, all their other bids are removed, and thus players they had winning bids on before will have new generals winning them. If this causes someone to have over 6,000 points in winning bids, that's not an issue (since it's after auction). Teams which are incomplete after this will be able to get them with the minimum possible bid at the end of auction.
If you find any loopholes in the algorithm or have a better algorithm in mind, please tell us.