As a direct answer to your question: Yes, there are better ways of protecting your gear from damage caused by a magnet. However, they might not be worth the effort.
My suggestions are:
Go magnet fishing with someone else. That way, one of you can carry your valuables and the other can carry kit you need for magnet fishing (rope and the like). This not only helps protect your belongings but helps you stay safe when on adventures.
Avoid taking valuables with you. Any card with a magnetic strip can easily be damaged by even a small magnet. As for technology, certain electrics can very easily be damaged (such as hard drives) but most modern smartphones won't be greatly affected. (We use magnetic phone holders all the time nowadays and LCD screens aren't really affected by magnets anyway).
It is correct that increasing distance from the magnet dramatically decreases its power, so wrapping it in socks or tying it to the outside of your bag may help. Putting it in an iron container would definitely help (as others have stated) but probably isn't worth the extra weight. If your bag has a 'top' pocket could you put your phone and wallet in that and put your magnet in the bottom of your bag?
Basically, you can happily take your phone along without much worry, but be careful with credit/ debit cards or anything that uses magnetic storage/ with delicate moving parts. Maybe leave them in your car/ at home - you are cutting down on weight after all (which is always helpful when hiking/ walking).
Note: I am not accountable for any damage that occurs to your belongings. I can only provide advice according to my experience. You should always check product manuals/ manufacturer info first. Why not google which things damage specific items in your kit how to avoid such damage.