The latest attempt in California to win ratification of the D.C. voting rights amendment failed early yesterday when the state Senate in Sacramento voted 21 to 18 against the proposal.

The drive to have 38 state legislatures ratify the amendment, which would give the District two senators and one of two members in the House, began in Sacramento nearly two years ago, just after the proposal was passed in Congress.

The amendment was originally approved by the majority of members of both houses of the California legislature in August 1978, by 50 to 19 in the Assembly and 22 to 16 in the Senate. But because its supporters were rushing to make California the first state to ratify the amendment, it was brought up under a suspension of rules that required a two-thirds majority for passage. If fell short of that goal in the Senate.

Periodically since then, supporters have tried and failed to win constitutional majorities -- that is, one more than half the full membership of the voting body.

The California House approved ratification a second time, by a vote of 46 to 31, on March 29, 1979. The amendment has been under active consideration in the Senate since this March.

Dick Clark, the Common Cause lobbyist who heads the coalition directing the ratification drive, was in Sacramento for the latest vote. Clark said yesterday that the issue is not dead there. Supporters will bring it up for reconsideration later this week if they can find the needed three extra votes.

The vote on the issue has been along largely partisan grounds in California, as elsewhere with only one of the Senate's 17 Republicans voting or ratification.

Since that early rush of enthusiasm two years ago, nine state legislatures have ratified the amendment, the latest coming April 17 in Hawaii. A dozen other legislatures have rejected the proposal. For the amendment to become law it must he ratified by 38 states by August 1985.