MovementX expression only works with mouse pointer lock (useful in 3D games).
What you need here is save click position in a variable
| Global number clickedX = 0
+ Mouse: On Left button Clicked
-> System: Create object Sprite on layer 0 at (Mouse.X, Mouse.Y), create hierarchy: False
-> System: Set clickedX to Mouse.X
+ Mouse: Left button is down
+ Sprite: Sprite = 0
-> Sprite: Set width to Mouse.X-clickedX
If your game is grid-based, I suggest using a tilemap instead, and draw walls on the tilemap.