We did the Panama Canal in May and the day we transited it was a bit overcast and showery but then you are in the middle of the rain forest and the water gathered in is used to work the system which is quite something to see. We went from Fort Lauderdale to Aruba and then the canal when we got to the Pacific end the viewing area was packed, why we don't know but they were cheering sounding off horns etc. We entered the canal about 9 a.m. 1 hour late due to traffic from the Pacific side and we cleared the other end around 4.30 p.m. We did get a certificate saying we had completed the full transit, but it was a very interesting experience.
Anytime is a good time but it is best to avoid the hurricane season which is roughly July to October. Rather than look for the best port, you should be looking for the best ship to suit your requirements. If you sail from a US port you have the usual long queues for immigration, which can be avoided by going elsewhere. If you want to cut down on flying it is worth considering a world cruise sector sailing from/to UK and places like Los Angeles and San Francisco through the canal, which will take around 18-20 days. Cunard & P&O do these.
We have just taken a Panama canal cruise with Celebrity, although the ship Mercury is starting to look a little tired we understand it is having a re-fit soon and can throughly recommend it. January we felt was a good time to go and the weather was perfect, not too hot, although a little rough when we hit the Atlantic. We went from West to East, but it would be wiser to try to get more direct flights than we had. Booking late meant flying to Charlotte Town NC then on to San Diego, which took up almost 24 hours, very tiring, but the return was not quite as bad, better if you could get a direct flight from Miami back though. As Ingle suggests do some research first and see which line suits your requirements best.
It can be best in December to April and some of the best prices can be found when the cruise lines resite the ships either going to Alaska or after the Alaska season. As mentioned it can be done at most times of the year. ..... Neil.
P&O's Oceana does a few full transits from about November to March with start/finishes at Acapulco and Barbados (or vice versa). Their direct dedicated flights would avoid the hassle with US Visas and queuing mentioned in other replies (unless the Acapulco flight requires a refuelling stop). The ship is also large enough to make the transit of each lock a bit of a squeeze and quite interesting.