What are the advantages of using a ramjet in an air-to-surface missile?
A rocket-powered missile carries both fuel and oxidiser and oxidiser is the heavier part. For example a gram of jet fuel needs almost 3.4 grams of oxygen to fully burn! Increasing the fuel load requires also increasing the power, which means even more fuel and this limits the practical range of a missile.

Ramjets are air-breathing, so they don't need to carry the oxidiser, which means the same amount of fuel gives them significantly longer range. Plus the other constituents of air, and extra air, that get pulled along and heated in the engine add to the available reaction mass, further increasing the propulsive efficiency.

Longer range means the aircraft can fire the missile further away and avoid coming into range of the defenses placed around the target, which might make difference between being able to attack a heavily defended target and not, so it is worth the expense to have some in stock.

Also note that ramjet is only more complicated, and expensive, than a solid-fuel rocket motor. Compared to liquid-fuel rocket it is simpler, because it only needs easy-to-handle kerosene while liquid-fuel rockets either need liquid oxygen, or nasty stuff like peroxide or hydrazine. It is also simpler compared to a full turbofan or turbojet (a small solid rocket booster is usually used to get it up to speed).