Why is the Social Security tax split midway between employer and employee?
It is actually a little bit more complex because there are special cases where there might be no tax burden shifting (see discussion in Mankiw Principles of Economics ch 12) although, generally speaking the statement of D. Friedman would be correct.
As to why government does that, besides incompetence that should not be too casually dismissed, there might be completely rational reasons.
If people do not understand economics, and if people do not understand that they are still being taxed, they might be more likely to vote to candidates that they believe are not taxing them (regardless of whether they are actually being taxed or not). This is fully consistent with those voters being rational mind you since rationality only requires people to act consistently with their beliefs and  makes no assumptions on what peoples beliefs are (see more discussion of rationality in Tadelis Game Theory: An Introduction). Consequently it might be rational for politicians to do this to maximize their votes.
For example, consider analogy with food producers. Some food producers put on their food labels reading &quot;no chemicals&quot;. This is prima facie absurd statement as anything made from ordinary matter even plain water is by definition made from chemicals. To have food without any chemicals the food would have to be made out of plasma  or dark matter. Even interpreted generously as meaning there are no synthetic chemicals, there is no real difference between synthetically made atoms and molecules and the same atoms and molecules being produced by nature.
Yet customers who are illiterate when it comes to physics and chemistry might still prefer such products 'without added chemicals' making it rational for profit seeking companies to produce such products.