Why are the leading edges on the Boeing 787 made from aluminum?
There are probably many factors in choosing aluminum vs. composites.

A big one is bird strikes. The leading edges are at the highest risk for this. Metal tends to absorb the impact better while retaining its strength, while composites would tend to delaminate and become much weaker. Resistance to in-flight hail must also be considered.


(Source Left, Right) Comparison of bird strike effect on aluminum and carbon fiber.

Anti ice was also mentioned. These areas are heated with bleed air (or, for the 787, electrical elements) to melt or prevent any ice formation. Metals do much better at high temperatures than composites, which would tend to melt or lose strength. Metals are also able to conduct the anti ice heat better than composites.

Another factor could be manufacturing. These surfaces have a lot of curvature. Composite panels are often reinforced with honeycomb core, which is best on relatively flat surfaces. Of course composites could be made into these shapes, but the shape would limit material and configuration options. Metal is also easier to work with or repair than composites.

As far as choosing aluminum over other metals, it tends to be very light and cheap for its strength, has decent temperature capability for anti-ice, and when properly used is fairly resistant to corrosion or fatigue.

The nose does not have anti ice and must serve as a cover for the weather radar. Composites can be made relatively transparent to radar, but metal would tend to block the waves.