It depends on how "dispensable" it is. Conversation, beliefs, philosophy, loves and hatreds, likes and dislikes, sympathy's and passions, are all parts of being a real person; what you are doing is character building, for a character that appears repeatedly and has something to do with the story.
Character and setting building are important and not always directly related to the plot. They can be, for example in Star Wars the setting and nature of Cloud City, where Luke gets his hand cut off, is important to the escape of all the good team. The setting of Hoth (ice planet) plays a role in Luke's developing command of The Force.
The important thing to remember is that you are trying to guide your reader's imagination of what is happening in the story, so a certain amount of leeway in the name of entertainment is permissible, but always keep in mind the pacing of your story. To illustrate with an overly obvious example, a fight to the death is not the time to be opining on whether prostitution should be legal or not. The best time for such opining is as filler during otherwise idle time, such as a necessary journey.
Make An Argument, a Challenge, a Conflict
I try to make such conversations at least friendly arguments. Conflict is a spice that can go a long way in turning bland assertions into something interesting. Even in ideas, even among friends. Disagreements in philosophy (I have them with my own best friends) are a form of battle, sparring or wrestling that usually results in a stand-off.
What you write should have consequences in the story, but that doesn't mean it has to influence the plot, per se.
It can influence the behavior of the hero without changing the plot, it can get readers invested in your philosophical character so they understand his actions at a crucial moment: Self-sacrifice, bravery, or cowardice or betrayal. So whatever he does, however he helps or hinders the protagonist, does not come off as a deus-ex-machina or too convenient choice, but as part of who he is and what he believes. If I am going to have Allen sacrifice his own life for "The Cause", I want Allen to do this out of true belief, and how do I show that? By showing several times throughout the story that Allen is a true believer. At the time I show this, it doesn't have to be apparent to the reader why I am showing it, but the point is character building: I want the reader invested in Allen so his later (and perhaps life-ending) actions seem plausible: Yeah, Allen would do that.
If somebody has gone to the trouble of adopting or developing a philosophy (as I have) then this should have some kind of consequences in their behavior (mine does). For good or evil. That helps make a memorable character.
It can also make a good foil, by finding arguments against this philosophy (that aren't infantile, dismissive, or too easily dismissed), the hero arguing against your philosopher is defined as well, and perhaps converted on some points.
Debate is a part of life, and a part of friendship. Typically amongst friends, allies and coworkers, there is a strong interest in not alienating the opponent or dissolving into insults and vitriol, so such arguments end before somebody gets angry. (Unlike the Internet, where a lack of any significant consequence in group cohesion lets insult and vitriol spiral out of control.)