Madame Loisel's envy of the upper class and of things that she doesn't have leads to her ruin in "The Necklace." Why do you think that is?
As the author of "The Necklace," Guy de Maupassant studied the rising bourgeosie in his country of France, he noticed its concern with the acquisition of material possessions and in the inordinate value that this class put upon these possessions. In his opening paragraphs, Maupassant conveys this materialistic attitude of the bourgeosie:
She was one of those pretty and charming girls, born, as if by an accident of fate, into a family of clerks....She dressed plainly because she could not afford fine clothes, but was an unhappy as a woman who has come down in the world...She grieved incessantly, feeling that she had been born for all the little niceties and luxuries of living. She grieved over the shabbiness of her apartment,...and the ugliness of the draperies. All these things, which another woman of her class would not even have noticed, gnawed at her and made her furious.
Madame Loisel's character flaw of placing the value of material possessions above all others is her nemesis. The diamond necklace is more important than her school-girl friendship with her friend, more important than making her husband's life worthwhile, more important than even her own happiness. Because she places the value of the necklace above all else, she "replaces" it so that what she believes in her grievous mistake can be concealed. In truth, however, she sacrifices the most valuable possessions a person can have--friendship, a happy marriage, a contented life.
Other interpretations of "The Necklace" exist than the one your question suggests. Mathilde is a normal human being who longs for a finer, more artistic existence. She is a woman with imagination, and she is smart enough to know that society is not all it could be. Your question blames Mathilde, but evidence exists that society is at fault here as much or more than Mathilde.
Maupassant is considered a naturalist writer. His writing is about human victims of forces they cannot control. Mathilde is not ideal, but she is a normal, intelligent human. She's smart enough not to just accept her place in society. She's creative and imaginative and has as much right as anyone else to the things she dreams of. She is similar to a frustrated artist, who longs to create and is not allowed or able to do so.
Just to demonstrate this with one point. Only a person too poor to have any experience at all with jewelry would not even consider the possibility that the necklace may have been costume or fake jewelry. Anybody with any experience with jewelry would know that that was a possibility. But Mathilde does not. Why? Not because she's stupid--she's not. She doesn't consider the possibility because she is not of that world, she has no experience with jewelry. The situation is beyond her control, beyond her capability.
Again, Mathilde is in part a victim of societal forces beyond her control.
It is perfectly natural for people to want what they can't have, whether it is an expensive item of some kind of forbidden fruit. Such is the case with Madame Loisel in Guy de Maupassant's short story, The Necklace. She had long learned for many of the luxuries that she saw others around her enjoy, and she dreamed of being apart of the upper crust of society. Neither of these hopes seemed possible until her husband came home with the invitation to the ball. She saw it as her one chance--no matter how fleeting--for her to attain these dreams. The fact that, on top of requiring an expensive new gown, she desired expensive jewels to accessorize it proved to be her ultimate downfall. Her husband could afford the dress and the taxi home, but he could not afford to replace the diamonds once the necklace was lost. Madame Loisel's misplaced importance over a single evening's event proved to be a selfish desire that cost her (and her husband) many years of unnecessary personal grief and despair.
Madame Loisel envy did not have to lead to her ruin because she really did not have to act on that envy. You can envy something, but not be so fixated on that thing as she is.
So she could have just accepted her position in life, even as she envied those above her. After all, I think most of us go through life thinking it would really be nice to have more money so we could have this thing or that thing. But we do not all try to act as if we were rich. We do not have to go in debt to try to get a bigger house or a nicer car, even if we would like to have those things.