One might wonder about the timing, but upon consideration I think it was brilliant. As the iPad finally made it into customers' hands, reviews pointed out many of the shortcomings of the device, including the lack of printing, the absence of support for Adobe Flash, and no multi-tasking. Less than a week after those reviews started appearing, iPhone OS 4 is announced with its signature feature, multi-tasking. Thus does Apple give the impression that it was way ahead of us, not enough to be ready when the iPad was ready, but ahead nonetheless.
The new OS will be available in the June timeframe for iPhone and iPod Touch and in the fall for the iPad.