Why do many ram air inlets have this shape?
Those are called NACA inlets or NACA ducts. As wikipedia mentions:


  When properly implemented, a NACA duct allows air to flow into an internal duct, often for cooling purposes, with a minimal disturbance to the flow.


So yes, there is an aerodynamic advantage.
As for the "why", if you're in the mood, you can have a detailed look at the original report (I'm not able to properly summarize it).