Finding the shortest path in a grid which has walls
Let $w$ be the width of the grid and $h$ be its height. Let $n = w \cdot h$.
The following solution requires $O(n k)$ time and works regardless of whether there are restrictions on the direction of movement. If the movement is allowed only downwards and rightwards then there is a solution with a running time of $O(n)$, which is better whenever $k$ is not a constant (see Nir Shahar's answer). 

Assume that there is no wall on the upper-left cell (otherwise remove it, and decrease $k$ by $1$).

Construct a directed graph $G$ as follows: the vertex set $V=\{1,\dots,h\} \times \{1, \dots, w\}$ consists of $n$ nodes. A generic node $(i,j) \in V$ represent the cell in the $i$-th row and $j$-th column of the grid.

There is an edge between vertex $u$ to vertex $v$ iff it is possible to move (in one step) from cell $u$ to cell $v$ without breaking a wall on $v$.
If all directions of movement are allowed this is equivalent to saying that $u$ and $v$ are adjacent and there is no wall on $v$.

Create a directed graph $H$ consisting of $k+1$ copies $G_0, G_1, \dots, G_k$ of $G$.
Intuitively the $i$-th copy represents the situation in which exactly $i$ walls have been broken.

Augment $H$ as follows: for each $i=0, \dots, k-1$ add an edge from vertex $u$ of the $i$-th copy to vertex $v$ of the $(i+1)$-th copy iff it is possible to move (in one step) from cell $u$ to cell $v$ but this requires breaking a wall on $v$.
Again, if all direction of movement are allowed this is equivalent to saying that $u$ and $v$ are adjacent and there is a wall on $v$.

Finally, add a new vertex $t$ and all the edges from vertices $(\ell, \ell)$ in all of the $k+1$ copies of $G$ to $t$.
Notice that the number of vertices is $O(nk)$ and that the number of edges is linear in the number of vertices.

It now suffices to find a shortest path $P = \langle v_0, v_1, \dots, v_h \rangle$ from vertex $(0,0)$ in $G_0$ to $t$.  This can be done in time $O(nk)$ using, e.g., a breadth first search from $(0, 0)$ in $G_0$.
The sought shortest path on the grid has length $h$ and is obtained by traversing the cells corresponding to vertices $v_0$ to $v_{h-1}$.