As the developer, ConcernedApe, has not spoken on this matter, we have no way of knowing whether it's intended or a bug.
Now that the question has been changed, I'm afraid the answer is still pretty boring: it just happens. Keep giving gifts and paying attention to your spouse, and friendship will (always?) reach 13 hearts out of 12.