How to encode reachability in a graph with walls as a SAT problem
The point of my exercise is to encode the path existence in CNF


Well, a trivial way to do this is by reducing the problem to 2-SAT, following this set of rules:


Assing a literal to every edge of your graph, for example first element in first row become $a$, second element in first row become $b$ etc. 
Put in OR relation the literal in the "start" position with each adjacent literal (
thus obtaining the clauses of your formula). If one or more adjacent literal has value 1, omit the clause in which it appears. Note that, when they are both 0, you dont need to repeat them:
if you have an adjacency between $a$ and $b$, you do not have to repeat the clause between $b$ and $a$.Furthermore you must not consider the diagonal adjacencies. 
Perform the same procedure for all the literals adjacent to the starting one and for those in turn, until you reach the destination literal.
Connects all the obtained clauses  with an AND


To better adapt to your example, in which a 0 value means "you can pass" and a 1 value means "you cannot pass", you can negate all the literals in the formula.

So for the  matrix in the first above example  the corresponding path existence encoded into 2-SAT instance will be:

$(\not a \lor\not d) \land (\not d \lor\not e) \land (\not e \lor\not f) \land (\not f \lor\not c)$

By replacing the matrix values in the first example, the formula evaluates to 1, which means that this formula encodes a valid path.
However, for the secon matrix in the example, you never obtain a true formula in which the ending literal is present, so there is no valid path.