If the profile of a wing pulls a plane up, why can planes fly inverted?
Normally, an airfoil is optimized for best lift/drag (L/D) efficiency for a certain flight profile (usually a compromise). Since most of the time for most aircraft inverted flight is not an issue, you get an airfoil that is optimized for upright flight, and this is best achieved with asymmetric geometries.

However, depending on the angle of attack any airfoil can (and will) generate "negative" lift, only much less efficiently so, than for the optimized regime,  resulting in increased drag. 

The desired angle of attack for conventional aerodynamically controlled aircraft is maintained by the elevator. For symmetric airfoils commonly used for aerobatic planes, the performance for upright and inverted flight is quite similar. For 99% of all other airfoils inverted flight will work up to a certain point, depending on the available power, CG, the maximum lift and rudder forces availabe before stall. As a result, for some aircraft, a stable inverted flight cannot be maintained, while for others it could be (but with varying penalty to performance, stall speed etc). The aerodynamical possiblity of inverted flight is of course limited by structural and other considerations.