The main goal of any romantic relationship is to achieve a situation in which you and your partner live together for the rest of your lives. Usually, this would be done in the context of a marriage though that is not always the case today. If you want to stay married for life, it is very important to share the same values because that will help to prevent major conflicts from arising in your marriage.
When you are married, you expect your spouse to be in agreement with you on all of the major issues that face you. You also want to be able to love your spouse completely and so you do not want them to hold views that are repugnant to you. If these criteria are not met, conflict is likely.
For example, let us imagine a couple in which one partner holds a view repugnant to the other. This could be a view on gay rights. One partner might think that homosexuality is abhorrent to God. If the other partner believes that homosexuality is natural and that those who disapprove are bigoted, it will be hard for the two partners to continue to respect and love one another. The same would be true if one partner thought their relationship with God was the most important thing in life while the other thought religion was a hoax played on gullible people.
Differing values also cause problems in more practical ways. Imagine that you and your spouse disagree on how to raise children. You want to discipline your children rigidly and to use corporal punishment when necessary. Your spouse believes that corporal punishment is wrong and that it is best to give children relatively free rein. Such a marriage would have terrible problems because the spouses would disagree on practically every decision relating to child rearing.
For reasons like these, it is important to share a core set of values with your partner in a marriage or similar relationship.