Why did the 747-8's freighter version make its first flight before the passenger version?
The launch customers for the 747-8 were Cargolux and Nippon Cargo Airlines, both air freight operators who wanted the 747-8F. The first orders for the 747-8I didn't materialize until several months later.

Source: Wikipedia