I remember this being mentioned as not intentional, but at the very least it is not intuitive. This behavior goes far back and I can't find any bug report mentioning it.
In order to move multiple stacks at once between inventories, you double-click on one stack of the type of item you want to move. However, this only works while holding an item, any item. And that makes the interaction absolutely counter-intuitive. Why would you need to hold any item with your cursor to move a set of entirely unrelated items?
To reproduce:
1. Open any container, such as a chest. Make sure it (or your inventory) contains multiple full stacks of the same type, e.g. stone.
2. Hold shift, then double-click any of those stacks. Notice how the stack moves to the other inventory at the first click and nothing happens on the second click of the double-click.
3. Click any other item stack and just keep it on the cursor.
4. Repeat step 2. Notice how on the first click again only the clicked stack moves, but on the second click (on the now empty slot) all other items of the same type move as well. The item held on the cursor is unaffected by this interaction.
Expected behavior:
Either the type of the item grabbed in step 3 should have any meaning, or steps 2 and 4 should behave the same way. (probably the latter)
Thank you for your report!
We're tracking this issue as MC-6870, so this ticket is being resolved and linked as a duplicate.
That ticket has already been resolved as Won't Fix, which means this is considered a bug but won't be fixed. The description of that ticket or the comments might explain the rationale. Please do not leave a comment on the linked ticket.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki