Do you reduce the CR of monsters with resistance to Fire or Lightning when facing a party with no Fire- or Lightning-based attacks, since the resistance doesn't affect that party?
I'm going to guess that, no, you don't, even though it doesn't affect play. Non-magical weapon resistance is no different. Some parties will be affected by the resistance. Other parties will not. But the monster remains the same, and should have the same CR, either way.
Madness lies down the path of adjusting CR to discount abilities which don't affect the PC party: "We need to have one spell of every element, so that all elemental resistances will contribute to CR. We also need one person with a non-magical weapon, so that non-magical weapon resistance will contribute. Etc."
For the purposes of the resistance/immunity example in the original question:
"bludgeoning, piercing, and slashing from nonmagical weapons that aren't silvered"
The "weapons" portion of the example is actually sufficient to know that it does not apply against the example sources of damage, magical or not. The resistance only applies to specific damage type subcategories of weapon damage. None of the given examples are weapon attacks, so this resistance/immunity to damage from weapons does not apply to the given non-weapon examples in the question regardless of what type of damage is being done.
That said, errata has updated most (all?) instances of the given resistance/immunity example in the question to the following:
Bludgeoning, Piercing, and Slashing from Nonmagical Attacks that aren't Silvered
(Weapons -> Attacks)
Now it's clearer that the magical status of the attack itself should be considered.
The Sage Advice compendium provides the following checklist for determining if something is considered magical (see also: How do I know if an ability is magical?)
If you cast
antimagic field, don armor of invulnerability, or use another
feature of the game that protects against magical or nonmagical
effects, you might ask yourself, “Will this protect
me against a dragon’s breath?”
[...]
Determining whether a game feature is
magical is straightforward. Ask yourself these questions
about the feature:
- Is it a magic item?
- Is it a spell? Or does it let you create the effects of a spell
that’s mentioned in its description?
- Is it a spell attack?
- Is it fueled by the use of spell slots?
- Does its description say it’s magical?
Since the question's examples are all spells or spell attacks, they fall cleanly under the umbrella of being magical. As such, thorn whip and the initial spell attack of ice knife are considered magical attacks, which clearly bypasses the errataed resistance/immunity text. Damage dealt as an effect of spell that isn't related to a spell attack roll (like the damage of earth tremor) is both magical and not from an attack, so the resistance/immunity text also doesn't apply there.
It's also worth noting that there's currently no such thing as an attack that is both a spell attack and a weapon attack, as noted in answers to a question about how to refer to non-spell attacks.
Best Answer
Though at first glance it might appear, that if the DM does not give out magical weapons, then many monsters in the DM's Basic Rules will make half of the party irrelevant unless the DM gives out magical items and thus the game is dependent on magical items, unlike what the article states. However, a close look at the classes and character abilities reveals that this is not the case.
Firstly, there are two spells, magic weapon and elemental weapon, which will make any nonmagical weapon into a magical weapon. Magic weapon, however, only works on one weapon as it is a concentration spell, and is not available until 3rd level as it's a level 2 spell available to Wizards, Paladins and War Domain Clerics.
At level 6, Monks and Circle of the Moon Druids both get abilities which make their unarmed or natural attacks count as magical weapon attacks.
The Paladin and Warlock at third level gain an ability to have their weapon count as magical - the warlock through the Blade Pact boon, and the Paladin through the Sacred Weapon channel divinity.
Looking over the monsters in the DM Basic Rules, no creature below CR 5 has immunities to nonmagical weapons (meaning these immunities should not be encountered until the party is of a high enough level to deal with them) save the Werewolf; however, the werewolf's immunities can be bypassed by magical weapons or silvered weapons. Silvered weapons can be obtained by spending 100 gold per weapon in just about any location that sells weapons.
So while the Player's Handbook makes it very clear that magic is still a big part of D&D, and magic in general is assumed in the game, the delivery of special magic items from the DM to the players is not. Teamwork, resourcefulness, and character abilities will allow you to overcome any challenge without requiring magic items or making magic items part of the assumed progression of character development.
Of course, as a DM, one should make sure that the party has the necessary information to prepare for battles where immunities of any kind might completely shut down a player.
It is worth noting, that perhaps unlike in other versions of D&D, in 5e the math is used partially to enhance the story, and partially to "fade to the background" while playing the game.