I fully understand the rationale behind it and the only issue I have with the present system is that the the team in the next round benefits.
What about this idea- the first yellow carries into the 2nd leg and a a 2nd yellow is effectively a red. In that the opponent benefits from any transgression within the tie. The slate is then cleaned for the next round. This also prevents the losing team in the final minutes of going out from hacking their opponent.
Not sure it would really prevent this. If a team was going out, and some of their players really wanted to kick lumps out of the other team, then they are going to do that irrespective of if they get sent off or not. Another yellow card (effectively a red card in your terms if they already have a yellow card from the 1st tie) isn't going to be a deterrent because they are going out anyway (i.e. not play in the next game). Being sent off and making it harder for their team to win the game won't matter because they are going out of the cup anyway.
The opposition
should benefit from teams that have ill discipline. If your team progresses through the competition by bullying other teams and persistent fouling and generally distasteful play, then there
should be a deterrent to such a team progressing. The point of having good discipline is to promote teams to play good football rather than turn matches into some sort of opportunity to be thugs. Fans don't want to watch a team just batter and bruise other teams in order to progress through the world's premier club competition. They want to watch fast paced, high intensity games between top level athletes where plenty of skills are displayed and players express themselves positively through feats of athleticism, innovation, charisma and style rather than ill tempered aggression, violence, cheating and generally poor sportsmanlike conduct. In other words, that's fans want to turn up and watch Man City or Liverpool rather than say Everton or whoever else Fat Sam or Pulis happens to be coaching.