Using modulus in one time pad? I would like to know what is the real purpose of using a modulus in the equivalent of a Vernam cipher:

Data $d$, large number $M$.
Assume the key length is $\lambda$ bits. Then $M$ could be $2^\lambda$.
$k$ is picked from $\{0,1\}^\lambda$ using a pseudo random function (PRF)

Encryption: $C = k + d \pmod{M}$
Decryption: $d = C - k \pmod{M}$

What's the purpose of using $M$?
It depends on what you think of as an alternative. 

If you think of the scheme where you do not use $M$ as a modulus, but the keys a picked as:
$$
k \leftarrow \{1, \ldots, M-1\} 
$$
Encryption: 
$$
C = d + k
$$
Decryption:
$$
d = C - k
$$
Then the scheme is insecure. One way to see this is to note that we have $C \geq d$. So the ciphertext communicates the information that $d \leq C$. 

You could also think of a scheme where there is no $M$ at all:
$$
k \leftarrow \mathbb{Z} 
$$
Encryption: 
$$
C = d + k
$$
Decryption:
$$
d = C - k
$$
This would be secure, however, it would be impossible to implement because there is no way to sample $\mathbb{Z}$ (the integers) uniformly at random (think about it, how would you do that?).

So you see $M$ is really quite essential to the scheme.