He set his resignation after April 2nd, which is important for his state Wisconsin. According to Wisconsin law, if a sitting member resigns within a specific time before an election that seat is to remain vacant until the election.
So, he waited to leave until he could f**k over the other Republicans the best way he could. Their 'majority' is now down to 1 seat.