Mushrooms are the fruiting bodies of a fungal mycelium. Fungal intelligence (if it exists) is quite distributed, and exists mostly in the mycelial structure, since that’s where it eats and grows. It only puts up mushrooms when there are favorable conditions.
This is not to dismiss your concerns about sentience; it is an interesting topic. Compare with a raspberry, for example. That is the fruiting body of a plant. It has the capability to produce many other plants from its seeds. Part of the plant’s strategy is to be eaten by birds and then shat out, and so dispersed much more widely than it would be by wind.
Mushrooms are different in that you can take a piece of one, stick it into some growth medium, and get more mycelial growth from it, unlike the plant material around a seed. They are maybe roughly analogous to pluripotent stem cells in that respect. But a mushroom’s main reason for being is to send out spores, not to act as a central part of the organism’s “mind.” If it was essential, it wouldn’t rot after a few days.[0]
If we ignore for a moment the question of sentience, then it is clearly more ethical to eat a mushroom than a carrot, or any other root vegetable. Pulling a carrot kills the whole plant, while picking a mushroom does not kill the organism.
They’re just…weird. That’s part of why I love them. Somewhere between plant and animal, hard to map our notions of existence and intelligence onto, a mysterious form of existence, etc.
[0] Some species have very hardy mushrooms, so this reasoning doesn’t necessarily apply to them, but they are also inedible.