Could someone explain me why it double jumps?

Hello, I couldn’t find anyone else with the same issue so I am posting it.
I followed the Creating a Basic Platformer Game tutorial from unity. With their code I was applied some of it into another code, but for 3D.
The code is about the property of being only able to jump once. In my code, the player can jump twice for some reason.
With this code I am also getting the error "NullReferenceExceptionL Object reference not set to an instance of an object. Line 26. Which would be the only line inside of grounded.

public float speed = 5.0f;
public bool facingRight = true;
//public float maxSpeed = 10.0f;
//public bool jump = false;
public float jumpForce = 100f;

private Transform groundCheck; // check the ground/ceilling/ or anything we might use - might be useful later
private bool grounded = false; // touched the ground/ceilling/ or anything we might use

private Rigidbody rb;
// Use this for initialization
void Start () {
    groundCheck = transform.Find("groundCheck");
    rb = GetComponent<Rigidbody>();
}

void Update()
{
    grounded = Physics.Linecast(transform.position, groundCheck.position, 1 << LayerMask.NameToLayer("Ground"));
}

void OnCollisionStay()
{
    grounded = true;
    
}
// Update is called once per frame
void FixedUpdate () {
    float moveHorizontal= Input.GetAxis("Horizontal");

    Vector3 movement = new Vector3(moveHorizontal, 0);
    rb.AddForce(movement * speed);

    if (Input.GetKeyDown(KeyCode.Space) && grounded)
    {
        rb.AddForce(new Vector3(0,  jumpForce));
        grounded = false;
    }        
}

Could someone explain me why I am double jumping? Thanks in advance and sorry if there was actually someone who had the same issue.

Use

void OnCollisionEnter2D(Collision2D other)
	{

if(other.gameObject.layer == " Ground" )
grounded = true;
}

OnCollisionStay triggers WHILE you are jumping , resulting in a Grounded being true.
Also Kossu is right about Input.Update() is better for registering input.
I do not get why are you using linecast AND OnCollision.
Use one of them and check for tag/layermask.

void OnCollisionEnter2D(Collision2D other)
	{
if(other.gameObject.tag == "Ground")
{
		grounded = true;
	}
}

//  P.S I'm a bit rusty.Haven't done unity in a while.Don't hold a grudge for any typos haha.

grounded is handled by Physics.Linecast so why you use

void OnCollisionStay(){
     grounded = true;
 } 

and make sure only the ground object have a LayerMask called Ground. by the way you can declare a public LayerMask and choice from inspector better to make sure ground not set to every thing

 public LayerMask WhatIsGround;  void Update()
 {
     grounded = Physics.Linecast(transform.position, groundCheck.position,WhatIsGround);
 }