Before offering clients your unsolicited opinions, you should consider whether holding your tongue might be necessary in order to maintain a good client relationship.
Clients pay us for our input — that's why we call ourselves consultants. But that doesn't mean clients want our opinions about everything. Knowing when to speak and when to keep silent distinguishes the art of consulting from its imitations.
Obviously, if your client asks for your opinion on any subject, you should provide a response. But don't be afraid to admit your ignorance and offer to research it, rather than fabricating something on the spot.
When you consider offering your unsolicited opinion, ask yourself whether this topic could impact the outcome of the project for which they hired you. If so, then you must speak up, no matter what other objections you face. Otherwise, you're neglecting your duty to your client.
Even if not directly related to your project, if you perceive a potential advantage for your client to embrace, or a disadvantage for them to avoid, then you should bring it to their attention. The more the subject falls into your realm of expertise (or out of your client's), the more this rule applies.
Consider whether your client has already made up their mind on the subject. Unless you can demonstrate a clear risk or opportunity, you have no need to beat that dead horse just to voice your personal preferences.
Don't discount emotional ties to a prior decision. Humans naturally favor their past course of action (choice-supportive bias). They may possess other non-logic-based ties to a particular path, too. These might include feeling aligned with a group, especially the "in crowd." You can spot that by their use of the word "everybody," or its equivalents like "enterprise developers these days." Questioning their decision threatens to separate them from the right-thinking group. The need to stay with the herd runs deep.
Given these considerations, we can easily see that topics such as religion, politics, and sports fail nearly every test. I avoid having these conversations with clients unless I know them well enough to feel certain that we can conduct a friendly, non-threatening discussion that won't strain our relationship. In fact, when you can do that, such dialogues strengthen the bond between you and your client. But if you try to open those subjects too early, they'll likely label you an opinionated jerk.
It gets much more tricky at the edge cases, however. Something like your client's choice of development frameworks can border on religion, yet it can also pack a heavy punch for your project. You need to balance each of the considerations above, and if you decide you should speak up about it, be careful how you approach it. "I can't believe you're using X! Man, you should be on Y!" is equivalent to saying "Whoever decided on X is obviously a biased idiot, or at best negligent in considering your options." That directly threatens the status of said person. It also paints you in bold Y-fanboy colors. Instead, try something less emotional such as, "I think you could benefit from revisiting that decision."
Sometimes, we just need to realize that we live in a sub-optimal world. Constantly revising decisions in order to always make the best choice will result in never getting anything finished. Sometimes you just need to run with what you're given. After all, it's not the system, it's the execution that matters. Other times, taking a step back and changing directions can make all the difference. Knowing which is which is part wisdom, part luck.