Why does ibuprofen and naproxen cause ankle swelling, and meloxicam cause ankle and leg swelling? Should I get my kidneys checked?

Side effect. The nsaids have a side effect of retaining fluid and can cause a host of other bad problems. They are not innocuous pills to be taken like candy. This fluid retention is a serious issue. And you need to avoid these medications better to find ou what is toxic in your body that needs to be cleansed rather then take dangerous medication to cover symptoms.
Most . Of this class of drugs nsaids can cause fluid retention . No reason to get kidneys checked unless something else is suspected.
SIDE effects. Yes when you take this type of meds for longer periods kidney function should be periodically checked. Also careful with stomach issues can cause bleeding from gastritis or ulcers. Take as little as possible for as short time if poss.
Salt retention. Most nonsteroidal antiinflammatories such as ibuprofen, mobic, (meloxicam) Naproxen , and even Celebrex all cause salt and water retention, thus may cause swelling in some patients.