Ideal commute distance depends on what I want. Will I commute every day? Can I shower at work?
If I was to commute every day by bike, I think a shorter commute, 5-10 miles each way would be ideal. You can always make your commute longer by going the scenic way. Maybe on the lower side of that if I couldn't shower at work.
My current commute, 16-17 miles each way depending on exact route, is really nice length for a workout without being too long, especially since I have the option for taking transit for all or part of it if I want and I have a shower at work.
I think as you get more than 20 miles it would be hard for me to do regularly, just due to the time commitment.