Theorem: Let $\kappa$ be strongly inaccessible in $V$, such that $V \models ZFC$. If $M\models ZF$, then $L(M) \cap V_\kappa = M$.
Proof: Let us prove by induction on $\alpha < \kappa$ that $L(M) \cap V_\alpha = M \cap V_\alpha$.
Let $x \in L(M) \cap V_{\alpha + 1}$, so $x \subseteq M \cap V_\alpha$. Let $\gamma$ be an ordinal such that $x\in L_{\gamma}(M)$.
Let us find $X \prec L_\gamma(M)$, such that:
- $x\in X$, $V_\alpha \subseteq X$,
- $X \cap \kappa \in \kappa$
- $X \cap M$ is transitive
and equal to $M \cap V_\beta$ for some $\beta$
This is possible by the strong inaccessiblity of $\kappa$:
We define, by induction of $n < \omega$, $X_n$. Let $X_0 = M\cap V_{\alpha} \cup \{x\}$. Extend $X_0$ to $X_0'$ such that $X_0'\prec L_\gamma(M)$ and $|X_0'| = |X_0| < \kappa$. Now, take $X_1 \supseteq X_0'$ such that assumptions 2 and 3 hold ($M \cap X_1$ is transitive and $X \cap \kappa$ is ordinal). $|X_1| < \kappa$, by the inaccessiblity of $\kappa$. Let $X_1 \subseteq X_1' \prec L_\gamma(M)$, and so on. Let $X$ be $\bigcup X_n$.
Let $\bar{X}$ be the transitive collapse of $X$. $\bar{X} = L_{\bar{\gamma}}(\bar{M})$ where $\gamma < \kappa$ and $x\in \bar{X}$. Since $M \cap X$ is transitive, $\bar{M} = M \cap X$. Since $M\cap X = M \cap V_\zeta$ for some $\zeta$, $\bar{M} = M \cap V_\zeta \in M$ (as $\zeta \leq \bar{\gamma} \in \kappa$). In particular, $M$ can compute the model $L_{\bar{\gamma}}(\bar{M})$ and compute $x$. We conclude that $x \in M$.
Remark: Without the inaccessibility assumption, one can get a model $M$ of ZFC such that $L(M) \cap V_{\omega + 1} \neq M \cap V_{\omega + 1}$.
Let us start with $V = L$ and let $\kappa$ be a worldly cardinal of countable cofinality. Let $\langle \alpha_n \mid n < \omega\rangle$ be the first cofinal sequence of singular cardinals with limit $\kappa$, in the canonical well order of $L$. Let us consider the following class forcing in $L_\kappa$: for every singular cardinal $\mu\in L_{\kappa}$, let $\lambda = \mu^{++}$, and force with the lottery sum of $Add(\lambda, \lambda^{++})$ and the trivial forcing. Take the $<\kappa$ support product of those forcing notions. This forcing does not collapse cardinals. Let $c$ be a Cohen real. Let $G$ be an $L_\kappa$-generic filter such that $L_\kappa[G] \models 2^{\alpha_n^{++}} = \alpha_n^{+4}$ iff $c(n) = 1$. This is possible by splitting the forcing into class forcing that only decides for which cardinal $\lambda$ we force $2^\lambda = \lambda^{++}$ (this class forcing does not add sets) and the second step in which we change the value of the corresponding $2^\lambda$-s. In $L[c]$ one can find a generic for the first step that codes $c$ as above.
Let $M = L_\kappa[G]$. $c \notin M$ (as $M$ and $L$ share the same reals), while $c \in L(M)$.