As recently tested today, compasses do not seem to point towards a spawnpoint when a new one is in place. Compasses only point towards spawn and do not change when the player's spawnpoint changes. This bug occurred in a singleplayer, vanilla, 1.18.1 world. To make sure this wasn't a mistake I made, I made sure to sleep in the bed again before testing this, but the same result occured.
For the images, the first one shows a player character standing nearby a village, the custom made house is where the bed/new spawnpoint resides. The compass is facing away from the bed. The second image shows the bed/new spawnpoint and the compass is facing away.
Environment
Windows 10, Java Version
Thank you for your report!
We're tracking this issue in MC-518, so this ticket is being resolved and linked as a duplicate.
That ticket has already been resolved as working as intended, which means this is not considered a bug and won't be fixed. Please do not leave a comment on the linked ticket.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki