So we have $L$ bits, which gives us a binary string of length $L$. We have $N$ of these, all different.
If we take $2$ and the $XOR$ gate, then count the number of $1$'s, this is the Hamming distance. In other words, the number of bits that are different.
We can do this for all combinations of our binary strings, and find the minimum.
What is the highest this value can be?
Note that this is not equivalent to finding an optimal ratio $f(N)$ so the value is $\lfloor Lf(N)\rfloor$. (unproven, just my guess)
If it works though, this easy construction provides a lower bound of $f(N)\ge \frac{1}{2}, \forall N$:
Begin with $[00,01,10,11] \implies N=4 \land L=2$.
Double the digits, replacing a $0$ with $00$ and $1$ with $11$. Make a copy of the list where all even numbered bits are flipped. Merge the lists. $N$ and $L$ have both doubled. Repeat this step until $N$ and $L$ are large enough, then throw away excess binary strings and trim length.
A tighter bound $f(N)=\frac{g(N)}{2g(N)-1},g(N)=2^{\lceil log_2(N)\rceil-1}$:
Set $k$ as the smallest power of $2$ for $k\ge N,k>L$. Construct the $k\times k$ Hadamard matrix. Replace $-1$ with $0$. Remove the first column (it's all $1$'s). Read the rows as binary strings. Trim as necessary to meet $N$ and $L$.
First few are $f(2)=1$ from $[0,1] \land f(3)=f(4)= \frac{2}{3}$ from $[000,011,101,110]$.
Let $d(x, y)$ be the number of different bits between words $x$ and $y$. If we have a set of binary words $C$, define $d(C) = \min \{d(x, y) : x\neq y\}$ to be the distance between the two closest words. You are trying to maximize $d(C)$ for a give $N=|C|$. Instead, fix $d(C)$ and maximize $N$.
For $L$ bits, $N = |C|$ strings, can we achieve a distance $r = d(C)$? Such a solution is called a $(L, N, r)$ code. This problem is well studied. The largest numbers of strings is given by the bound.
$$N \leq \frac{2^L}{\sum_{i=0}^{r}\binom{L}{i}}$$
The hamming bound is exact, in that there are codes (sets of strings) with $$N = \frac{2^L}{\sum_{i=0}^{r}\binom{L}{i}}$$ See perfect codes.