Why do bikes have carbon forks? I have noticed many bikes for sale that are made of mostly one material, such as aluminum, except for the fork which is carbon. I know carbon is very expensive so the manufacturer must be trying to use a little bit in the best possible place. So, if for a certain price point they can choose only one part to be carbon, why the fork? What are the advantages of carbon forks?
There are an intersection of a number of reasons:


Public Perception - Carbon as that "wow" factor.  Colloquial it is associated with "space age"  technologies.  Therefore it must be better!  The truth is that the performance of carbon depends heavily on manufacturing techniques used (e.g., materials and layup).  See point 3 for an example.
Weight - Carbon has a high strength to weight ratio. Carbon forks really started to take a hold when steel was still a dominant frame material and during a period in the cycling industry when there was a serious obsession with weight savings. As such, carbon quickly became got the reputation of being material of choice for building light stiff components.  Compared to building forks from some other materials (e.g., an all steel fork) significant weight savings can be had. The weight difference to other materials such as aluminum however is not as significant, but once the public perception is set is hard to go against the grain..
Compliance - Because carbon has good fatigue resistance - it can be flexed nearly an infinite number of times without failure, if the force is less that the critical limit where structural failure occurs - this means it has the potential to be very compliant, if manufactured appropriately.  However it is expensive to customize carbon, because of all the molds required.  As such, many carbon components are intended for a wide use case (e.g., rider weight) and therefore are typically overbuilt for most people needs due to the failure mode of carbon being catastrophic.  As such, carbon forks (which are often lauded for compliance)  can also be harsh.  It really depends on how the part was manufactured and what your weight and use cases are.  Just buying a carbon fork does not guarantee a compliant ride.  For example, the most compliant fork I have ever ridden to date was a thin walled steel fork, it soaked up high frequency road vibrations like you wouldn't believe. My modern 2017 all carbon "endurance" bike with a "compliant" fork comes pretty close, but the difference is still noticeable (which I attribute to accommodating for disc brakes and thru-axle).
Ease of manufacturing - As others have pointed out in this thread, forks are separate components so it is easy to use another material here, especially if you can order forks at a good price. This makes it a relatively cheap upgrade on the production line especially considering point (1).
Economies of Scale - Because carbon forks have been popular for so long now, manufactures know how to produce them relatively cheaply now.  As such, this again makes it an easy upgrade (see previous point).
Quality cannot be visually determined - It is difficult (impossible really) to determine the manufacturing quality of a carbon fork by looking at it.  You need to scan or cut it apart.  This means that manufactures can opt for the cheapest fork possible but still maintain a look of high quality (assuming point 1).


From a functional/practical stand point I think there are many instances where carbon forks do not make sense (e.g., commuter bikes), but manufactures include them because of the public perception out there (which ironically manufacturers helped create). For most regular bikes, I think a steel fork is a more sensible choice: It typically offers a compliant ride and is more robust to physical damage than carbon; but many would view a steel fork as a step backwards simply because steel is colloquially viewed as an "old" material. 

Don't get me wrong, I think you can build a very nice bike out of carbon (my daily ride is one), but I think carbon is at its best when it is tailored for its use case, which typically means more higher end bikes.  I would personally skip carbon on lower end bikes as I don't think it provides any advantages as manufacturing and use case coverage dictates that it is often over-built with cheaper layups.  The problem with carbon fiber is that as a consumer you have no visual way of telling whether the carbon fiber fork (or frame or whatever) you are looking at is of a high or low quality, both will typically look identical.