In my mind, this will depend on how much you contributed to the grant, and what stage of your career you're in. I'll also ignore things like the NSF or NIH requiring reporting research support even if you aren't the PI for biosketches and the like.
If you're a graduate student or (depending on the grant) a postdoc, it's reasonable that you wouldn't be the PI, because you can't be the PI by institutional rules, or because in the current funding climate, or with the scope of the grant, etc. there's just no way a postdoc-PI grant is going to get funded. Never the less, putting it on your CV shows that you're thinking about funding and participating in the process, even if you aren't heading it up. It's the grants equivalent of being a middle author on a paper as an undergrad.
What's important though is, as with every element of your CV, that you be able to cogently talk about what it was about, and how you contributed to the writing of it. It's one thing to say "My supervisor was the PI, but I did the bulk of the writing and planned out the grant" and something else entirely if you were just along for the ride.