Some tubs come with integrated support, but that only works well IF the floor is level. You really want the tub's upper surfaces to be level so that the designed interior slopes properly, and you don't get pooling of water on the horizontal surfaces, or it being directed out into the room. If it's not level, it also makes adding a sliding glass door messy or tiling the walls.
So, the mortar underneath can solve that problem for you by first leveling the tub and second, providing support. Note, if the tub is CI, it's strong enough to support itself, but it still needs to be leveled, if the floor isn't right. Most of the acrylic, steel, and fiberglass tubs out there will deflect when you're standing in them unless you've provided good support. That flexure can cause stress cracking, and depending on the drain, eventually cause that to leak.
Some expanding foam gets brittle when it cures...some is more resilient. The stuff that ends up brittle can end up dust over time from movement that might be from weight or thermal expansion.