Option 1: Drop it
Sometimes we think something is a problem, but other people think it is not a problem. When we appeal to an authority to adjudicate such a dispute, they might decide against us. Even though we still think the position is wrong, one decision we can make is to drop the matter out of respect for the authority in question. Depending on how important the issue is, how much we respect the authority in question, how much we care about the issue in question, and how much effort we are willing and able to spend, we can drop it temporarily until there is further evidence the decision was wrong, drop it permanently but not change our underlying beliefs or processes that cause us to disagree on the matter, or drop it permanently and try to learn from it and change our beliefs. Each of these is a good decision some of the time.
For example, in your specific case you might decide the moderator's judgement that the use of profanity in this case is acceptable by the network guidelines, while not something you approve of or agree with, isn't that big a deal. Then you might take a deep breath, go on a 15-minute walk, and move on with your life.
Option 2: Garner and Demonstrate Support
On SE, policies generally are formed democratically. If you want to get the moderators to do something and they aren't, the best way is definitely not to try to go over their heads but rather under their feet. Post on your per-site meta (not here) a very thorough, well-worded and sourced explanation of what happened, why you thought it was a problem, what the moderators did, and what you think they should have done instead (in this case this is the same as the why you think it is a problem section, so this section should be omitted) and ask for an explanation as to why the moderator team made that decision. One should be polite and calm in this post, even more than usual.
For example, in your specific case if you wanted to go this route you might post a meta discussion question with something like:
Why was this moderator flag declined? It seems to me like this post is in violation of these SE network principles (link). That makes me think we would need to edit the post to remove the objectionable content. Am I misunderstanding our site's implementation of the network policy on profanity?
as the body.
The moderators will then explain themselves, and the community will assess their response. If the response to their response is overwhelmingly negative then they will change their behavior or things will blow up in a really bad way and then the CM team will (hopefully) get involved-- you can look up your CM by site and there is a contact email address listed. Again, that's not the first step, though, the first step is demonstrating that your position is reasonable and has a good amount of support from the site.